-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting detected by cloudflare #1388
Comments
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 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 |
Same issue for me. Crawling 24 hours a day during last month, I got stuck a few hours ago. |
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. |
I tried adding the dev-tools option @benkrej but I'm just getting the word "None": options.add_argument( '--headless' ) print(message) |
You will have to scrape and structure the data yourself, |
god bless you man! |
It worked, thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
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 |
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. |
try to use pyautogui to close dev panel |
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:
|
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.
|
God damnnn that worked ! |
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 |
thank u man!!! it works fine for me!!! |
I click the checkbox with mouse, also applied random waits to simulate real human, but still stuck. I guess it is detecting selenium somehow |
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. |
Good to know that it works with playwright! |
note that your way need to use headless=False, so it means it will fail when someone uses headless mode. |
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 |
| I'm not sure the 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. |
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. vvanglro/cf-clearance#58 |
I just needed to do 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. |
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. |
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: #1455 (comment) |
@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! |
thanks, bro. Everything works. |
Youre absolutely right, but at the the same time I just tried to comment out the '--headless' line and it works perfect too without any long loading Here's my working code version:
|
are you using package for rendering ? For example: Xvfb |
I am, I can relate to having issues automating my browsers whenever the system is headless and I rely on Xfvb. |
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
The text was updated successfully, but these errors were encountered: