ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
10.09k stars 1.17k forks source link

Unable to get through Cloudflare #1585

Open Jackhammer010 opened 1 year ago

Jackhammer010 commented 1 year ago

Hello, Really appreciate the work you do here. I'm attempting to scrape this URL: "https://sheriffalerts.com/cap_office_disclaimer.php?office=56622" and I am unable to get through Cloudflare.

This is the code I'm trying to use: import time

import undetected_chromedriver as uc

options = uc.ChromeOptions() options.headless = False options.add_argument('--headless') chrome = uc.Chrome(options=options,version_main=116) chrome.get('https://www.icrimewatch.net/index.php?AgencyID=56622') time.sleep(35) chrome.save_screenshot('screenshot1.png') chrome.quit()

Screenshot shown below:

screenshot1

Am I doing something wrong. Please let me know if any suggestions.

Thanks

LUXTACO commented 1 year ago

You could try to open a new window with smth like Ctrl+t and just switch the actions to that window, it normally works for me.

Or another fix is to use another UD chrome driver, I found out that drission works well for bypassing cloudflare

krypterro commented 1 year ago

What do you mean by: "another UD chrome driver," I'm only aware of one chromedriver binary, are there other compiled versions?

LUXTACO commented 1 year ago

It's a python library https://pypi.org/project/DrissionPage/1.1.3/, it supposedly works for bypassing Cloudflare but to be 100% honest I haven't tested it, nor I intend on testing it, I personally just reverse the site and use requests

krypterro commented 1 year ago

What do you mean by "reverse the site"?

LUXTACO commented 1 year ago

Inspect the site to see how it works to then use that info to interact with the site in a way you want

Nlkita357 commented 1 year ago

You could try to open a new window with smth like Ctrl+t and just switch the actions to that window, it normally works for me.

Or another fix is to use another UD chrome driver, I found out that drission works well for bypassing cloudflare

Hello, I bypassed cloudflare as you said and I have everything working but as soon as I use headless mode it stops bypassing cloudflare. Can you advise how to make the code bypass cloudflare by opening another page in headless mode. Thanks

LUXTACO commented 1 year ago

umm, tbh I don't know how you would be able to do that, do you need it to be headless?

g1879 commented 11 months ago

您可以尝试使用 smth 打开一个新窗口,例如 Ctrl+t,然后将操作切换到该窗口,它通常对我有用。 或者另一个解决方法是使用另一个 UD chrome 驱动程序,我发现 drission 可以很好地绕过 cloudflare

您好,正如您所说,我绕过了cloudflare,并且一切正常,但是一旦我使用无头模式,它就会停止绕过cloudflare。您能否建议如何通过在无头模式下打开另一个页面来使代码绕过 cloudflare。谢谢

Tips: user-agent