Open vndhote opened 1 year ago
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' )
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.
@benkrej Hi, For now, I can use playwright to pass the cf challenge without opening the debugging tool.
About cf turnstile captcha:
In the first case, after detecting the environment, you can pass without clicking.
In the second case, you need to click to confirm the real person before you can pass. (This case is related to the proxy ip you use, and elite proxies generally do not appear).
The last case requires you to identify specific things in the picture. In this case, I haven't encountered it yet while using playwright.
Good to know that it works with playwright!
@benkrej Hi, For now, I can use playwright to pass the cf challenge without opening the debugging tool.
About cf turnstile captcha:
- In the first case, after detecting the environment, you can pass without clicking.
- In the second case, you need to click to confirm the real person before you can pass. (This case is related to the proxy ip you use, and elite proxies generally do not appear).
- The last case requires you to identify specific things in the picture. In this case, I haven't encountered it yet while using playwright.
note that your way need to use headless=False, so it means it will fail when someone uses headless mode.
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
not working bro
@NCLnclNCL try the dev tools workaround then
Both workarounds are no longer working, fyi everyone. I'm sure it's being worked on, but in the meantime I just created a small browser extension that opens up the page I want and then sends the HTML to a little proxy server which writes the results to a file that my other processes can read. I knew that this was going to happen, especially with "workarounds" like the two that were found, but I had hoped for a bit more time. CF team is really going in on this "war of attrition". It reminds me a lot back in like 2015-2016 when I played a similar game with Google engineers and with streaming video from Google Drive accounts. Unfortunately it ended up being a losing game for me in the long term, but I think with AI being where it is currently that ultimately CF will lose this war. If anyone is interested I can make a repo with my browser extension and proxy server with some instructions on how to set it up as a temporary workaround. The downside is that you'll need a computer @ home (or wherever I suppose) that can have a browser up and running as often as you need to get the latest contents of that page. I still have to do some testing to see how it does over time, particularly when I'm afk, but I think worst case I might just have to add some mouse jiggle or something like that. If I start getting captcha'ed then obviously that will only work if I'm around, but otherwise the page I need generally loads automatically after a couple redirects from CF. If I end up running into the captcha problem I might setup some kind of push notification / chat server bot thing that can notify me and then setup a way to be able to "solve" the captcha from wherever I'm at. Combine that with a few other people besides myself running the same thing and hopefully we'll have a "workaround" that can last a lot longer, even if it's only to get us through periods like this where we're "losing".
I'm not sure the digital communications agency based in Glasgow, Scotland
needed to be tagged in this. 😉
| I'm not sure the digital communications agency based in Glasgow, Scotland
needed to be tagged in this.
lmao, my bad tag removed. Still not fully awake yet it seems, thanks for the quick heads up. You're one of the people working on a more permanent solution I believe, right? If so then thanks a lot, I know it's definitely appreciated by a lot of people as well.
Both workarounds are no longer working, fyi everyone. I'm sure it's being worked on, but in the meantime I just created a small browser extension that opens up the page I want and then sends the HTML to a little proxy server which writes the results to a file that my other processes can read. I knew that this was going to happen, especially with "workarounds" like the two that were found, but I had hoped for a bit more time. CF team is really going in on this "war of attrition". It reminds me a lot back in like 2015-2016 when I played a similar game with Google engineers and with streaming video from Google Drive accounts. Unfortunately it ended up being a losing game for me in the long term, but I think with AI being where it is currently that ultimately CF will lose this war. If anyone is interested I can make a repo with my browser extension and proxy server with some instructions on how to set it up as a temporary workaround. The downside is that you'll need a computer @ home (or wherever I suppose) that can have a browser up and running as often as you need to get the latest contents of that page. I still have to do some testing to see how it does over time, particularly when I'm afk, but I think worst case I might just have to add some mouse jiggle or something like that. If I start getting captcha'ed then obviously that will only work if I'm around, but otherwise the page I need generally loads automatically after a couple redirects from CF. If I end up running into the captcha problem I might setup some kind of push notification / chat server bot thing that can notify me and then setup a way to be able to "solve" the captcha from wherever I'm at. Combine that with a few other people besides myself running the same thing and hopefully we'll have a "workaround" that can last a lot longer, even if it's only to get us through periods like this where we're "losing".
Yes bro, i need extention
Passing the challenge with debug turned on seems to have been fixed by cf.
There are already cf people who are paying attention to related discussions and project, so if we continue to openly pass the challenge method, it will undoubtedly be a tug of war.😪
I have announced that stop maintaining my project. https://github.com/vvanglro/cf-clearance/issues/58 Although I tried a new way to pass the challenge. I can't make it public because it will be fixed by cf. My idea is to provide an api service that can happily pass the challenge without making it public.
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 just needed to do driver.execute_script('window.open("http://nowsecure.nl/#relax");')
(the #relax is not important for the issue but for another issue https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/934) and then by a doing a sleep of around 30 seconds, I had time to complete the CAPTCHA manually.
By using a custom profile, the CAPTCHA will not be asked for some time after we completed it (I did not check for how long yet). However it does not work on all websites using Cloudflare CAPTCHA: https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/1455.
Does someone have an idea why we need to open a new tab to avoid detection? I wonder which JavaScript code Cloudflare is using to detect this because in a normal web browser, we don't need "window.open".
Update: if we don't use a custom profile, switching tabs is still necessary if we want to execute JavaScript code like an alert (https://www.geeksforgeeks.org/execute_script-driver-method-selenium-python/) on the target website but opening another domain name like in the solution from benkrej was not necessary. The first tab switch was not necessary either because WebDriver has control on it by default even if it is showing the second tab.
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 just needed to do
driver.execute_script('window.open("http://nowsecure.nl/#relax");')
(the #relax is not important for the issue but for another issue #934) and then by a doing a sleep of around 30 seconds, I had time to complete the CAPTCHA manually. By using a custom profile, the CAPTCHA will not be asked for some time after we completed it (I did not check for how long yet). Does someone have an idea why we need to open a new tab to avoid detection? I wonder which JavaScript code Cloudflare is using to detect this because in a normal web browser, we don't need "window.open".
because the driver is in another tab, if you switch to the tab you just opened you will be detected
@NCLnclNCL Do you know which JavaScript code they can use to detect this?
@ultrafunkamsterdam is working on it as it seems so it may be worth to wait for his release. https://github.com/ultrafunkamsterdam/undetected-chromedriver/discussions/1420
@benkrej The workaround with the tabs switch is still needed with the new version 3.5.2. I also have another issue: https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/1455.
You have to find a workaround yourself everything published is getting patched very soon.
@benkrej Maybe there are things they cannot patch. If I find a workaround, I think I will share it.
Maybe it would be good to approach it another way and try to fix uc so it won't get detected in the first place without any temporary solutions. Would be awesome to have a chromedriver again like it was for the longest time!
@benkrej I found a workaround: https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/1455#issuecomment-1672334158 I hope I did not make a mistake by sharing it :D
@baptx Works only with visible challenges some sites have no visible challenge and therefore are still stuck in the infinite loop. Glad you found a way that works for you!
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