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
9.41k stars 1.12k forks source link

Is the Undetected Driver still Working? #1090

Open DiTo97 opened 1 year ago

DiTo97 commented 1 year ago

Hi @ultrafunkamsterdam,

Since the beginning of the week I have been trying to access the usual test toy website, but no luck.

Is the anti-detection logic of the undetected driver still working on your part?

AndyEckersall commented 1 year ago

Following, I've had the same issue, a site that was working previously now seems to be detecting the chrome driver since the start of the week.

--Update. When I downgrade my version of UC to 3.2.1 it doesn't appear to be able to detect it again. For ref using chrome driver version 110

DiTo97 commented 1 year ago

Following, I've had the same issue, a site that was working previously now seems to be detecting the chrome driver since the start of the week.

--Update. When I downgrade my version of UC to 3.2.1 it doesn't appear to be able to detect it again. For ref using chrome driver version 110

Thank you @AndyEckersall,

I will try version 3.2.1 and see if that works

AndyEckersall commented 1 year ago

Make sure to implement the patch fixes if you still have issues.

https://github.com/ultrafunkamsterdam/undetected-chromedriver/pull/1010

I have this code running also:

cdc_props = driver.executescript('const j=[];for(const p in window){' 'if(/^[a-z]{3}[a-z]{22}_.*/i.test(p)){' 'j.push(p);delete window[p];}}return j;') if len(cdc_props) > 0: cdc_props_js_array = '[' + ','.join('"' + p + '"' for p in cdc_props) + ']' driver.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument', {'source': cdc_props_js_array + '.forEach(k=>delete window[k]);'})

lukect commented 1 year ago

Make sure to implement the patch fixes if you still have issues.

1010

I have this code running also:

cdc_props = driver.executescript('const j=[];for(const p in window){' 'if(/^[a-z]{3}[a-z]{22}_.*/i.test(p)){' 'j.push(p);delete window[p];}}return j;') if len(cdc_props) > 0: cdc_props_js_array = '[' + ','.join('"' + p + '"' for p in cdc_props) + ']' driver.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument', {'source': cdc_props_js_array + '.forEach(k=>delete window[k]);'})

If you are using my fork you don't need this extra snippet.

dogi-sol commented 1 year ago

If you are using my fork you don't need this extra snippet.

I'm already using your fork, but I'm still being detected by Datadome (https://antoinevastel.com/bots/datadome). Starting with a new IP and an empty profile folder, the first load is successful, but if I refresh the page or try to access it again, I get detected. Even if I solve the captcha manually and correctly, it still gets blocked. This happens even if I don't perform any actions and just load the page and sleep until exit.

Fun fact: If I open the page in regular Chrome browser from a fresh IP address in incognito mode, it works fine. If I refresh the page, it still works. But when I open the inspector and refresh the page, it immediately blocks the IP address.

fusionconsulting commented 1 year ago

I'm seeing the same. Trying to work out what it's detecting. Have you had any more luck with this?

lukect commented 1 year ago

If you are using my fork you don't need this extra snippet.

I'm already using your fork, but I'm still being detected by Datadome (https://antoinevastel.com/bots/datadome). Starting with a new IP and an empty profile folder, the first load is successful, but if I refresh the page or try to access it again, I get detected. Even if I solve the captcha manually and correctly, it still gets blocked. This happens even if I don't perform any actions and just load the page and sleep until exit.

DataDome is a bogus test. Whether or not it allows me through on the linked page with my fork is entirely random. It 'detects' 20-30% of the time even without any automation. If it has marked you (based on their so-called 'machine learning solution'), you just need to rotate IP or fingerprint. You have not been 'detected' and it has nothing to do with automation.

Unfortunately some real ticketing websites (where I don't even bot on) use DataDome now and it constantly blocks me. The only way I can really use websites they 'protect' without hinderance is with a mobile browser. I suspect they will lose their clients soon as they drive real human customers away.

lukect commented 1 year ago

Fun fact: If I open the page in regular Chrome browser from a fresh IP address in incognito mode, it works fine. If I refresh the page, it still works. But when I open the inspector and refresh the page, it immediately blocks the IP address.

Yeah, don't open DevTools (the inspector). It's immediately detectable because of Chrome's natural behaviors. Some antibots will block you for that because you could paste an automation script into the console. As far as I know there is no way to specifically detect that JavaScript has been executed in the console, so they just check for you opening DevTools instead.

DiTo97 commented 1 year ago

Hi @lukect,

I just tried #1010 hoping not to get blocked again by a specific website. Unfortunately, it did not go through. I can paste below the page source of the web driver while being stuck at the challenge screen, if it may be of any help.

I think the challenge in place is Cloudflare's turnstile, or that's what I assumed after seeing this line in the page source:

<script src="/cdn-cgi/challenge-platform/h/g/orchestrate/captcha/v1?ray=7a8af5aceb272341"></script><script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=_cf_chl_turnstile_l&amp;render=explicit" async="" defer="" crossorigin="anonymous"></script>

For clarity, I am using WebDriverWait with a timeout of 30 seconds, as such:

options = ...
webdriver = uc.Chrome(options=options)

...

webdriver.get(...)

...

WebDriverWait(webdriver, 30).until(
    EC.presence_of_element_located(
        (By.CSS_SELECTOR, "<some-valid-selector>")
    )
)

but it always results in a timeout error, while I know for sure that the query selector is valid.