Skip to content

Commit 11e81b0

Browse files
committed
Update examples
1 parent 35dcd82 commit 11e81b0

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

examples/cdp_mode/raw_easyjet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
sb.cdp.click('[data-testid="month"]:last-of-type [aria-disabled="false"]')
2626
sb.sleep(1.2)
2727
sb.cdp.click('button[data-testid="submit"]')
28-
sb.sleep(2.5)
28+
sb.sleep(4.2)
2929
sb.connect()
3030
sb.sleep(1.2)
3131
for window in sb.driver.window_handles:

examples/cdp_mode/raw_hyatt.py

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
info = hotel.text.strip()
3030
if "Avg/Night" in info and not info.startswith("Rates from"):
3131
name = info.split(" (")[0].split(" + ")[0].split(" Award Cat")[0]
32+
name = name.split(" Rates from :")[0]
3233
price = "?"
3334
if "Rates from : " in info:
3435
price = info.split("Rates from : ")[1].split(" Avg/Night")[0]

examples/cdp_mode/raw_southwest.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
url = "https://www.southwest.com/air/booking/"
55
sb.activate_cdp_mode(url)
66
sb.sleep(2.8)
7+
cookie_pop_up = '[class*="PopOverContainer"] span'
8+
if sb.cdp.is_element_visible(cookie_pop_up):
9+
sb.cdp.mouse_click(cookie_pop_up)
710
origin = "DEN"
811
destination = "PHX"
912
sb.cdp.gui_click_element("input#originationAirportCode")

examples/cdp_mode/raw_theaters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
url = "https://architectureofcities.com/roman-theaters"
66
sb.activate_cdp_mode(url)
77
sb.cdp.click_if_visible("#cn-close-notice")
8-
sb.sleep(2)
8+
sb.sleep(1)
99
print("*** " + sb.cdp.get_text("h1") + " ***")
1010
for item in sb.cdp.find_elements("h3"):
1111
if item.text and "." in item.text:

examples/hack_the_planet.py

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ def test_all_your_base_are_belong_to_us(self):
114114
self.set_text_content(".profile-preview-card button", "SeleniumBase")
115115
if self.is_element_visible('h2 a[href*="simonh"]'):
116116
self.set_text_content('h2 a[href*="simonh"]', aybabtu)
117+
if self.is_element_visible('main h2 a[id*="article"]'):
118+
self.set_text_content('main h2 a[id*="article"]', aybabtu)
117119
self.highlight('[aria-label="Primary sidebar"] div div', scroll=False)
118120
self.highlight('nav a[data-text="Relevant"]', loops=1, scroll=False)
119121
self.highlight('nav a[data-text="Latest"]', loops=1, scroll=False)
@@ -124,6 +126,8 @@ def test_all_your_base_are_belong_to_us(self):
124126
self.highlight('nav a[data-text="Infinity"]', loops=3, scroll=False)
125127
if self.is_element_visible('h2 a[href*="simonh"]'):
126128
self.highlight('h2 a[href*="simonh"]', loops=7, scroll=False)
129+
if self.is_element_visible('main h2 a[id*="article"]'):
130+
self.highlight('main h2 a[id*="article"]', loops=7, scroll=False)
127131
self.highlight("section.crayons-card", loops=7, scroll=False)
128132

129133
self.open("https://azure.microsoft.com/en-us/services/playfab/")

examples/raw_ahrefs.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
sb.uc_click(submit_button, reconnect_time=3.25)
1111
sb.uc_gui_click_captcha()
1212
sb.wait_for_text_not_visible("Checking", timeout=11.5)
13+
sb.click_if_visible('button[data-cky-tag="close-button"]')
1314
sb.highlight('p:contains("github.com/seleniumbase/SeleniumBase")')
1415
sb.highlight('a:contains("Top 100 backlinks")')
1516
sb.set_messenger_theme(location="bottom_center")

0 commit comments

Comments
 (0)