diff --git a/examples/cdp_mode/raw_easyjet.py b/examples/cdp_mode/raw_easyjet.py index b071a2edbce..599277ffe43 100644 --- a/examples/cdp_mode/raw_easyjet.py +++ b/examples/cdp_mode/raw_easyjet.py @@ -25,7 +25,7 @@ sb.cdp.click('[data-testid="month"]:last-of-type [aria-disabled="false"]') sb.sleep(1.2) sb.cdp.click('button[data-testid="submit"]') - sb.sleep(2.5) + sb.sleep(4.2) sb.connect() sb.sleep(1.2) for window in sb.driver.window_handles: diff --git a/examples/cdp_mode/raw_hyatt.py b/examples/cdp_mode/raw_hyatt.py index 93f10941685..5c92a222a03 100644 --- a/examples/cdp_mode/raw_hyatt.py +++ b/examples/cdp_mode/raw_hyatt.py @@ -29,6 +29,7 @@ info = hotel.text.strip() if "Avg/Night" in info and not info.startswith("Rates from"): name = info.split(" (")[0].split(" + ")[0].split(" Award Cat")[0] + name = name.split(" Rates from :")[0] price = "?" if "Rates from : " in info: price = info.split("Rates from : ")[1].split(" Avg/Night")[0] diff --git a/examples/cdp_mode/raw_southwest.py b/examples/cdp_mode/raw_southwest.py index ba3f36f687c..fbf4bf2147e 100644 --- a/examples/cdp_mode/raw_southwest.py +++ b/examples/cdp_mode/raw_southwest.py @@ -4,6 +4,9 @@ url = "https://www.southwest.com/air/booking/" sb.activate_cdp_mode(url) sb.sleep(2.8) + cookie_pop_up = '[class*="PopOverContainer"] span' + if sb.cdp.is_element_visible(cookie_pop_up): + sb.cdp.mouse_click(cookie_pop_up) origin = "DEN" destination = "PHX" sb.cdp.gui_click_element("input#originationAirportCode") diff --git a/examples/cdp_mode/raw_theaters.py b/examples/cdp_mode/raw_theaters.py index f67b082b268..442c94544be 100644 --- a/examples/cdp_mode/raw_theaters.py +++ b/examples/cdp_mode/raw_theaters.py @@ -5,7 +5,7 @@ url = "https://architectureofcities.com/roman-theaters" sb.activate_cdp_mode(url) sb.cdp.click_if_visible("#cn-close-notice") - sb.sleep(2) + sb.sleep(1) print("*** " + sb.cdp.get_text("h1") + " ***") for item in sb.cdp.find_elements("h3"): if item.text and "." in item.text: diff --git a/examples/hack_the_planet.py b/examples/hack_the_planet.py index 1d5d3aa6b57..0d92f635758 100644 --- a/examples/hack_the_planet.py +++ b/examples/hack_the_planet.py @@ -114,6 +114,8 @@ def test_all_your_base_are_belong_to_us(self): self.set_text_content(".profile-preview-card button", "SeleniumBase") if self.is_element_visible('h2 a[href*="simonh"]'): self.set_text_content('h2 a[href*="simonh"]', aybabtu) + if self.is_element_visible('main h2 a[id*="article"]'): + self.set_text_content('main h2 a[id*="article"]', aybabtu) self.highlight('[aria-label="Primary sidebar"] div div', scroll=False) self.highlight('nav a[data-text="Relevant"]', loops=1, scroll=False) 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): self.highlight('nav a[data-text="Infinity"]', loops=3, scroll=False) if self.is_element_visible('h2 a[href*="simonh"]'): self.highlight('h2 a[href*="simonh"]', loops=7, scroll=False) + if self.is_element_visible('main h2 a[id*="article"]'): + self.highlight('main h2 a[id*="article"]', loops=7, scroll=False) self.highlight("section.crayons-card", loops=7, scroll=False) self.open("https://azure.microsoft.com/en-us/services/playfab/") diff --git a/examples/raw_ahrefs.py b/examples/raw_ahrefs.py index f815cb03117..86c884ee2c3 100644 --- a/examples/raw_ahrefs.py +++ b/examples/raw_ahrefs.py @@ -10,6 +10,7 @@ sb.uc_click(submit_button, reconnect_time=3.25) sb.uc_gui_click_captcha() sb.wait_for_text_not_visible("Checking", timeout=11.5) + sb.click_if_visible('button[data-cky-tag="close-button"]') sb.highlight('p:contains("github.com/seleniumbase/SeleniumBase")') sb.highlight('a:contains("Top 100 backlinks")') sb.set_messenger_theme(location="bottom_center")