Open pythbin opened 6 months ago
Right repo? This is working correctly in the latest version of seleniumbase
:
from seleniumbase import SB
def open_the_turnstile_page(sb):
sb.driver.uc_open_with_reconnect("seleniumbase.io/apps/turnstile", 3)
def click_turnstile_and_verify(sb):
sb.driver.switch_to_frame("iframe")
sb.driver.uc_click("span")
sb.assert_element("img#captcha-success", timeout=3)
with SB(uc=True, test=True) as sb:
open_the_turnstile_page(sb)
try:
click_turnstile_and_verify(sb)
except Exception:
open_the_turnstile_page(sb)
click_turnstile_and_verify(sb)
sb.set_messenger_theme(location="top_left")
sb.post_message("SeleniumBase wasn't detected", duration=3)
Right repo? This is working correctly in the latest version of
seleniumbase
:from seleniumbase import SB def open_the_turnstile_page(sb): sb.driver.uc_open_with_reconnect("seleniumbase.io/apps/turnstile", 3) def click_turnstile_and_verify(sb): sb.driver.switch_to_frame("iframe") sb.driver.uc_click("span.mark") sb.assert_element("img#captcha-success", timeout=3) with SB(uc=True, test=True) as sb: open_the_turnstile_page(sb) try: click_turnstile_and_verify(sb) except Exception: open_the_turnstile_page(sb) click_turnstile_and_verify(sb) sb.set_messenger_theme(location="top_left") sb.post_message("SeleniumBase wasn't detected", duration=3)
` iframe = WebDriverWait(driver, 30).until( EC.presence_of_element_located((By.XPATH, "/html/body/main/div/div/div[2]/form/div[3]/div/div/iframe")) ) print("Switching to iframe") driver.switch_to.frame(iframe)
# Click the element using uc_click
checkbox = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.XPATH, '/html/body/div[1]/div/div[1]/div/label/input'))
)
print("Clicking the checkbox")
checkbox.click()
# Assert that an element, indicating success, is visible
WebDriverWait(driver, 15).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "img#captcha-success"))
)
`
Im having this trying to access this page
https://account.jagex.com/manage/profile
It seems to not find the iFrame or the element to click? im converting this with undetectable chrome but seems to not work. I tried splitting this project into using 2 drivers but that also failed. Any helps appreciated!
Impossible to bypass the turnstile security for a week now when the checkbox needs to be ticked... Tried it on https://seleniumbase.io/apps/turnstile using Chrome 122, python 3.12.1. It was bypassing cloudflare perfectly before. Are there anyone else having the same issue ?