Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/raw_ahrefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
url = "https://ahrefs.com/website-authority-checker"
input_field = 'input[placeholder="Enter domain"]'
submit_button = 'span:contains("Check Authority")'
sb.driver.uc_open_with_reconnect(url, 2) # The bot-check is later
sb.uc_open_with_reconnect(url, 2) # The bot-check is later
sb.type(input_field, "github.com/seleniumbase/SeleniumBase")
sb.driver.reconnect(0.1)
sb.driver.uc_click(submit_button, reconnect_time=4)
sb.reconnect(0.1)
sb.uc_click(submit_button, reconnect_time=4)
sb.uc_gui_click_captcha()
sb.wait_for_text_not_visible("Checking", timeout=10)
sb.highlight('p:contains("github.com/seleniumbase/SeleniumBase")')
sb.highlight('a:contains("Top 100 backlinks")')
Expand Down
2 changes: 1 addition & 1 deletion examples/raw_form_turnstile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sb.click('span:contains("9:00 PM")')
sb.highlight_click('input[value="AR"] + span')
sb.click('input[value="cc"] + span')
sb.scroll_to("div.cf-turnstile-wrapper")
sb.scroll_to('div[class*="cf-turnstile"]')
sb.uc_gui_handle_cf()
sb.highlight("img#captcha-success", timeout=3)
sb.highlight_click('button:contains("Request & Pay")')
Expand Down
10 changes: 4 additions & 6 deletions examples/raw_games.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

with SB(uc=True, test=True, disable_csp=True) as sb:
url = "https://steamdb.info/"
sb.driver.uc_open_with_reconnect(url, 3)
sb.uc_click("a.header-login span", 4)
if not sb.is_text_visible("Sign in", "button#js-sign-in"):
sb.driver.uc_open_with_reconnect(url, 3)
sb.uc_click("a.header-login span", 4)
sb.uc_open_with_reconnect(url, 3)
sb.uc_click("a.header-login span", 3)
sb.uc_gui_click_captcha()
sb.assert_text("Sign in", "button#js-sign-in", timeout=3)
sb.driver.uc_click("button#js-sign-in", 2)
sb.uc_click("button#js-sign-in", 2)
sb.highlight("div.page_content form")
sb.highlight('button:contains("Sign in")', scroll=False)
sb.set_messenger_theme(location="top_center")
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.29.2"
__version__ = "4.29.3"
12 changes: 11 additions & 1 deletion seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,16 @@ def _uc_gui_click_captcha(
and driver.is_element_present("div.spacer div[style]")
):
frame = "div.spacer div[style]"
elif (
(
driver.is_element_present('[name*="cf-turnstile-"]')
or driver.is_element_present('[id*="cf-turnstile-"]')
)
and driver.is_element_present(
'form div div[style*="margin"][style*="padding"]'
)
):
frame = 'form div div[style*="margin"][style*="padding"]'
elif (
frame != "iframe"
and driver.is_element_present(
Expand Down Expand Up @@ -1017,7 +1027,7 @@ def uc_gui_handle_cf(driver, frame="iframe"):
time.sleep(0.02)
active_element_css = js_utils.get_active_element_css(driver)
if (
active_element_css == "div.cf-turnstile-wrapper"
active_element_css.startswith("div.cf-turnstile")
or active_element_css.startswith("div#PYMIw2")
):
found_checkbox = True
Expand Down