Comments (10)
I did not know that. Thank you, it worked!
from seleniumbase.
Thanks a lot for the pointer! @mdmintz
from seleniumbase.
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:
from seleniumbase.
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..
from seleniumbase.
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.)
from seleniumbase.
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)?
from seleniumbase.
@Tongcheng reconnect()
is a combination of three things:
- Stopping the WebDriver Service - https://github.com/SeleniumHQ/selenium/blob/ad17dd21b7c0e46405995ef9c44f473c3958f912/py/selenium/webdriver/common/service.py#L135
- Sleeping for a few seconds.
- Restarting the WebDriver Service
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.
from seleniumbase.
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"?
from seleniumbase.
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
from seleniumbase.
There's an explanation here already: #2213
from seleniumbase.
Related Issues (20)
- uc_cdp_events not functioning within Flask + SeleniumBase HOT 1
- Error "Unable to convert XPath Selector to CSS Selector" in seleniumbase 4.25.0 HOT 2
- Work with `pyautogui` and `seleniumbase` in a docker container HOT 10
- Maximize window function `maximize_window` raising `WebDriverException` HOT 2
- Issue with Handling Popup Alerts in SB() mode HOT 6
- Emojis and return lines not being processed properly by self.type HOT 1
- UC Mode's `driver.uc_click(selector)` isn't properly escaping selectors that contain quotes HOT 1
- Unable to pass cloudflare using UC Mode HOT 2
- Integrate Type Checks, to improve development experience. HOT 1
- Maintainer away for 3 days. Hold your questions until April 10. HOT 2
- Comparison between playwright and seleniumbase? HOT 4
- Is it possible to add selenum webdriver remote with seleniumbase. HOT 1
- How to add saved cookies to a new browser HOT 2
- Browser asks for SSL authentication in Selenium Grid. HOT 3
- When the previous step page is not yet fully loaded, the self. open() of the next step has already been run directly HOT 2
- I hope this script can use the previous browser HOT 11
- Unable to record keystrokes
- Can't pass bot detection on dexscreener.com on Linux HOT 7
- Add UC Mode `driver` methods directly into the `SB` API HOT 1
- Some elements cannot be inputted using the input method HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seleniumbase.