Skip to content
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

Website detects undetected bot #2589

Closed
jorisstander opened this issue Mar 10, 2024 · 10 comments
Closed

Website detects undetected bot #2589

jorisstander opened this issue Mar 10, 2024 · 10 comments
Labels
invalid usage You may need to change what you're doing UC Mode Undetected Chromedriver Mode (--uc)

Comments

@jorisstander
Copy link

jorisstander commented Mar 10, 2024

I have been trying to log in on a website but it keeps detecting me. This is what I do:

I create a driver and open google with it. From there I log in manually to my google account so that I have cookies on the profile. Next step I go to the website where I want to log in, but whenever i try logging in it detects me as a bot. Besides creating the chrome instance everything is manually.

I tried doing the exact same on my actual chrome and there I can log in without a problem. I also changed my IP and I still encounter detection. It seems like it knows i spun up an instance with seleniumbase but how is that possible?

Things i tried:
Remove the user_dir folder,
Change user-agent,
Change IP,
Created new google profile with cookies,
Checked recaptcha score which was 0.9.

If anyone has any suggestions I would love to hear them!

@mdmintz mdmintz added invalid usage You may need to change what you're doing UC Mode Undetected Chromedriver Mode (--uc) labels Mar 10, 2024
@mdmintz
Copy link
Member

mdmintz commented Mar 10, 2024

Sounds like you're trying to avoid detection after clicking a button to log in to a site.
You need to use the sb.driver.uc_click(selector) method in order to remain undetected.

Try these examples that use it:

@mdmintz mdmintz closed this as completed Mar 10, 2024
@jorisstander
Copy link
Author

I thought that was the issue at the start too. So I tried doing everything manually except for starting up the browser instance. So going to the website is manually -> filling in the information and clicking the log in, but still it knows i'm using a bot instance. So 0 interaction with a script and the target website. So it made me think it's maybe the settings of the browser which make it flagged as bot..

@mdmintz
Copy link
Member

mdmintz commented Mar 10, 2024

It's not so much your browser actions that get you detected, but mostly whether Selenium is connected to your browser when a website service is looking for it. UC Mode methods disconnect Selenium from the browser at specific times, and then reconnect after a few seconds (customizable).

If you want to perform manual action while in UC Mode, use this:

sb.driver.uc_open_with_reconnect(url, "breakpoint")

(Type c and press Enter to continue from the breakpoint.)

@jorisstander
Copy link
Author

I did not know that. Thank you, it worked!

@Tongcheng
Copy link

Thanks for the explanation @mdmintz , I'm still amazed and don't fully understand why "reconnect" would work when CF is heavy on a website. Is it due to certain "port" being occupied when selenium is connected to browser and that's how CF detects it (and the reason reconnect works)?

@mdmintz
Copy link
Member

mdmintz commented Mar 12, 2024

@Tongcheng reconnect() is a combination of three things:

After the WebDriver Service is stopped, Selenium is no longer attached to the web browser, and because of that, website services that try to detect Selenium won't find it.

@Tongcheng
Copy link

Great explanation @mdmintz ! I am curious if you know fundamentally (deeper inside chrome + selenium), how does detector able to tell "this browser is attached to selenium vs. not"?

@Tongcheng
Copy link

In other words @mdmintz , I am curious how you come up with idea, because when I did research, all evading direction seems to be "browser fingerprinting" etc., I didn't think it's some more fundamental attribute other than fingerprinting which could be detected

@mdmintz
Copy link
Member

mdmintz commented Mar 13, 2024

There's an explanation here already: #2213

@Tongcheng
Copy link

Thanks a lot for the pointer! @mdmintz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid usage You may need to change what you're doing UC Mode Undetected Chromedriver Mode (--uc)
Projects
None yet
Development

No branches or pull requests

3 participants