Open IlliaFransua opened 3 years ago
Then your ip is flagged/dirty. Do some regular surfing, solve some captchas, or get a new ip.
Copy pasting this code gives me the nice flashing page
I don't think it's an ip thing, I'm getting the same error on some cloudflare sites (possibly some extra-protection mode is enabled on them), I'll go to the page on the same ip in a normal browser and it says "Checking your browser before accessing" and then it'll refresh into the regular page with a single Ray ID, but in Undetected-Chromedriver it just refreshes the "Checking your browser before accessing" infinitely with a different Ray ID each time.
I noticed if I keyboard interrupt my script to end it but not close the selenium browser, Cloudflare will refresh into the regular page right after that, but if I have a time.sleep(99999) (or WebDriverWait) while waiting for the page it will just infinite refresh the Cloudflare page.
import undetected_chromedriver.v2 as uc
driver = uc.Chrome(version_main=92, patcher_force_close=True)
with driver:
driver.get('https://nowsecure.nl')
Works but
import undetected_chromedriver.v2 as uc
import time
driver = uc.Chrome(version_main=92, patcher_force_close=True)
with driver:
driver.get('https://nowsecure.nl')
time.sleep(9999)
Infinite refreshes (so you're unable to script anything).
Remove the sleep from the 'with' scope. And it will work. Timing is key here and you are interfering the workings of the driver this way. Using with already has sleep built in
Just move the sleep 4 positions to the left
Remove the sleep from the 'with' scope. And it will work. Timing is key here and you are interfering the workings of the driver this way. Using with already has sleep built in
I see, my script did not use 'with driver:' and no longer gets stuck with it, thanks!
import undetected_chromedriver.v2 as uc
driver = uc.Chrome(version_main=92, patcher_force_close=True)
with driver: driver.get('https://nowsecure.nl')
driver.find_element_by_xpath("//a[@class='btn btn-lg btn-secondary fw-bold border-white bg-white']").click()
driver.quit()
In my case, it's super weird, for the same site and same Wifi , same IP , my laptop bypass cloadflare but my PC didn't. I can't find the problem here please help me
import undetected_chromedriver.v2 as uc
from time import sleep
if __name__ == '__main__':
driver = uc.Chrome(version_main=96, patcher_force_close=True)
driver.get('https://swee.ps/SsjNs_ecByaoG') # known url using cloudflare's "under attack mode"
sleep(8888)
My Google Chrome version: 92.0.4515.107 (Official Build), (64 bit)
My Python version: 3.9.3
When I try to run the code you provided, it doesn't go through the Cloudflare protection. Code: