undetected-chromedriver
undetected-chromedriver copied to clipboard
Getting detected by cloudflare
undetected chromedriver worked well till yesterday but now, cloudflare improved and the chromedriver is not bypassing cloudflare. I have attached the screenshot of it. cloudflare is just looping the captcha when selenium is running. When I close it, the website loads.
This is my code snippet
It works fine when the script isn't running.
I also tried changing the binary to chrome rather than brave, but the issue still persists
I'm on the same spot, was working fine all this month and suddenly today it doesn't work
I have the same problem as you
I'm on the same spot, was working fine all this month and suddenly today it doesn't work
I guess it gonna take some time to improve the logics in undetected chrome driver to be undetectable. Anyone having solution to this kindly send me friend request and dm me on discord My discord Id : vivek9646
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Apparently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)
I tried adding the dev-tools option @benkrej but I'm just getting the word "None":
options.add_argument( '--headless' ) options.add_argument( '--auto-open-devtools-for-tabs' ) chrome = uc.Chrome( options = options ) message = chrome.get( 'http://bscscan.com/contractsVerified' ) #chrome.save_screenshot( 'datadome_undetected_webddriver.png' )
print(message)
You will have to scrape and structure the data yourself, driver.get
returns None. I suggest you to look into the coding examples.
Apperently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)
god bless you man!
It worked, thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
That worked mate, thanks!
Btw anyone knows how to close it afterwards? Site-specific protections detect me because it's opened.
I've tried action chains with Shift + Ctrl + i, but didn't succeed
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Does this not indicate that Cloudflare is perhaps tracking mouse movements now?
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Does this not indicate that Cloudflare is perhaps tracking mouse movements now?
Um.. like I tried using action chains to make it look more natural. I don't think so it may be mouse movements. It is possible that it's detecting selenium.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
That worked mate, thanks!
Btw anyone knows how to close it afterwards? Site-specific protections detect me because it's opened.
I've tried action chains with Shift + Ctrl + i, but didn't succeed
try to use pyautogui to close dev panel
pip install pyautogui
import pyautogui
pyautogui.hotkey("Ctrl", "Shift", "J")
add this to your code
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Yeah, it's somehow able to detect the underlying control of Python. When I open a browser with this code and navigate to a Cloudflare site it is looping. When I open a new window manually, I don't experience this issue. Everything else is controlled manually in both cases: navigating to the website, clicking the checkbox, etc. The only difference is how the window was opened.
This is literally all I am doing to open the window:
options = uc.ChromeOptions()
driver = uc.Chrome(options=options)
time.sleep(60)
anyone know how can i make its dock at bottom?(automated)(default setting is right)
I found out that if you open a new tab with js it passes cloudflare captchas. You can close the old tab and use the new one.
driver.execute_script('''window.open("http://nowsecure.nl","_blank");''') # open page in new tab
time.sleep(5) # wait until page has loaded
driver.switch_to.window(window_name=driver.window_handles[0]) # switch to first tab
driver.close() # close first tab
driver.switch_to.window(window_name=driver.window_handles[0] ) # switch back to new tab
time.sleep(2)
driver.get("https://google.com")
time.sleep(2)
driver.get("https://nowsecure.nl") # this should pass cloudflare captchas now
I found out that if you open a new tab with js it passes cloudflare captchas. You can close the old tab and use the new one.
driver.execute_script('''window.open("http://nowsecure.nl","_blank");''') # open page in new tab time.sleep(5) # wait until page has loaded driver.switch_to.window(window_name=driver.window_handles[0]) # switch to first tab driver.close() # close first tab driver.switch_to.window(window_name=driver.window_handles[0] ) # switch back to new tab time.sleep(2) driver.get("https://google.com") time.sleep(2) driver.get("https://nowsecure.nl") # this should pass cloudflare captchas now
God damnnn that worked ! thanks a lot mate
Apperently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)
I tried your solutions, this and the new one and it works on my local machine. However it cannot seem to work on AWS ec2 or Digitalocean droplet. Do you have any pointers where to look to solve this?
Apperently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)I tried your solutions, this and the new one and it works on my local machine. However it cannot seem to work on AWS ec2 or Digitalocean droplet. Do you have any pointers where to look to solve this?
Are you sure you are using the exact same code on your local machine and cloud? Try to match the python version as well as uc and chrome versions!
Apperently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)I tried your solutions, this and the new one and it works on my local machine. However it cannot seem to work on AWS ec2 or Digitalocean droplet. Do you have any pointers where to look to solve this?
Are you sure you are using the exact same code on your local machine and cloud? Try to match the python version as well as uc and chrome versions!
Yes, I use your code to test! Chrome and UC version are exactly the same the only difference is my local Python is version 3.10.10 while my DO server version is 3.10.6 .
I print driver.title for testing and in my local it returns nowSecure while in DO it returns Just a moment... (which is from cloudflare)
You might need to modify the first sleep, the cf protected site needs to fully load in the new tab in order for it to work.
Been trying changing that, still no luck
Apparently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)
thank u man!!! it works fine for me!!!
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Does this not indicate that Cloudflare is perhaps tracking mouse movements now?
I click the checkbox with mouse, also applied random waits to simulate real human, but still stuck. I guess it is detecting selenium somehow
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Yeah, it's somehow able to detect the underlying control of Python. When I open a browser with this code and navigate to a Cloudflare site it is looping. When I open a new window manually, I don't experience this issue. Everything else is controlled manually in both cases: navigating to the website, clicking the checkbox, etc. The only difference is how the window was opened.
This is literally all I am doing to open the window:
options = uc.ChromeOptions() driver = uc.Chrome(options=options) time.sleep(60)
I guess that is strictly related to detecting type of the handler that controls the browser, may be via JS. When I close bot, then the handler is kind of disposed, and so, CF realizes no automatic handler is back there and let me bypass. Can you test this scenario: Open the main window via code, then open a new tab and head to the same website manually.
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. IMPORTANT: When I close my bot and browser is still open, bypass is successful. This is strange for me.
Yeah, it's somehow able to detect the underlying control of Python. When I open a browser with this code and navigate to a Cloudflare site it is looping. When I open a new window manually, I don't experience this issue. Everything else is controlled manually in both cases: navigating to the website, clicking the checkbox, etc. The only difference is how the window was opened.
This is literally all I am doing to open the window:
options = uc.ChromeOptions()
driver = uc.Chrome(options=options)
time.sleep(60)
I guess that is strictly related to detecting type of the handler that controls the browser, may be via JS. When I close bot, then the handler is kind of disposed, and so, CF realizes no automatic handler is back there and let me bypass. Can you test this scenario: Open the main window via code, then open a new tab and head to the same website manually.
My second workaround does exactly what you described.
Apparently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)
For those who are less gifted like me and couldn't figure out where to insert this work around :
In utils.py at line 45 if you're running the default installation, you'll find a bunch of lines with adding arguments to the "options" variable .
replace "chrome_options" with options
et Voila everything should work now.
Apparently that's an issue with the cloudflare captchas. I found that it works when dev tools are open. Adding the following line resolved the issue for me.
chrome_options.add_argument("--auto-open-devtools-for-tabs") # automatically open dev tools on every new tab
(This is a not a pretty solution ofc, I had no time to dive deeper yet)
It seems that adding this line will consume more memory, does anyone encounter this?
Hello everyone, If you just need to pass the cloudflare challenge, You can refer to cf-clearance
@vvanglro your answer has nothing to do with the current issue. You might have not seen it but this is the cf turnstile captcha, not cf_clearance bot protection which is easily bypassed by using correct headers in your requests.