Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 63799c6

Browse files
committed
Update flight search examples
1 parent 99dcc10 commit 63799c6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎examples/cdp_mode/raw_easyjet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
with SB(uc=True, test=True, locale="en", ad_block=True) as sb:
44
url = "https://www.easyjet.com/en/"
55
sb.activate_cdp_mode(url)
6-
sb.sleep(2.5)
6+
sb.sleep(2)
77
sb.cdp.click_if_visible("button#ensCloseBanner")
88
sb.sleep(1.2)
99
sb.cdp.click('input[name="from"]')

‎examples/cdp_mode/raw_elal.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from seleniumbase import SB
23

34
with SB(uc=True, test=True, locale="en") as sb:
@@ -21,10 +22,11 @@
2122
print("*** Prices List: ***")
2223
for element in elements:
2324
prices.append(element.text)
24-
for price in sorted(prices):
25+
prices.sort(key=lambda x: int(re.sub("[^0-9]", "", x)))
26+
for price in prices:
2527
print(price)
2628
print("*** Lowest Price: ***")
27-
lowest_price = sorted(prices)[0]
29+
lowest_price = prices[0]
2830
print(lowest_price)
2931
sb.cdp.scroll_down(12)
3032
sb.sleep(1)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /