seleniumbase / SeleniumBase

📊 Blazing fast Python framework for web crawling, scraping, testing, and reporting. Supports pytest. Stealth abilities: UC Mode and CDP Mode.
https://seleniumbase.io
MIT License
5.45k stars 985 forks source link

Can't bypass cf turnstile on windows #3114

Closed Damji7 closed 2 months ago

Damji7 commented 2 months ago

am using sb.uc_gui_click_captcha() , is not working anymore..!!

mdmintz commented 2 months ago

When you open a ticket, you need to provide clear steps to reproduce your issue. This includes a minimal reproducible example. sb.uc_gui_click_captcha() is working for me on Windows.

mdmintz commented 2 months ago

Also, make sure you don't make any selenium or driver calls between the uc_open_with_reconnect() method and the uc_gui_click_captcha() method. They can detect that. Calls the methods together. Eg:

sb.uc_open_with_reconnect(url)
sb.uc_gui_click_captcha()
Damji7 commented 2 months ago

It works when you do it like this, but when the turnstile appears again the sb.uc_gui_click_captcha() keeps clicking it and the turnstile won't go, so by that the webpage shows me the rate limited text 1015 error..

mdmintz commented 2 months ago

It sounds like you have a for loop to fix. I can't help if you don't show the code.

Damji7 commented 2 months ago

sorry for being late, here is the code " def open_croatia(sb): screen(sb) url = config.get('URLS', 'SITEONE') sb.uc_open_with_reconnect(url, 4) sb.uc_gui_click_captcha()

def turnstile(sb): start_time = time.time()

try:
    sb.uc_gui_click_captcha()
except Exception as e:
    print(f"Error handling captcha: {e}")

    sb.sleep(8)

elapsed_time = time.time() - start_time
if elapsed_time > 60:
    print("Captcha not passed within 1 minute, restarting...")
    sb.driver.quit()

am calling the def turnstile in more places in the code, it was working before, but now when the turnstile appears while the script is running it keeps clicking without bypassing it, i've did the for loop, the while true, the while sb.is_text_visible..., with no results

mdmintz commented 2 months ago

Try on 4.30.5 (or newer if available)

Damji7 commented 2 months ago

now is not clicking at all, how to send you a video so you can see ..