Hyperlinks #2239
-
Hi so I have a few questions: (I should of put a better title for this discussion)
Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
One: SeleniumBase automatically opens links in new tabs if there's bot-detection software on those websites. (It checks first). There are additional methods for that: (Covered in this video: https://www.youtube.com/watch?v=5dMFI3e85ig) driver.uc_open(url)
driver.uc_open_with_tab(url)
driver.uc_open_with_reconnect(url, reconnect_time=None)
driver.uc_click(selector) Be sure to use those methods when the default behavior isn't good enough. And be sure to watch the video for details. Two: If you directly type a URL with the keyboard into the browser's address bar, then you're going to get detected because chromedriver is still attached to Chrome. That's the primary thing that bot-detection services check for. SeleniumBase UC Mode disconnects chromedriver from Chrome briefly when loading a website that has anti-bot services running on it. This tricks those websites into thinking that web automation is not involved, and therefore they believe the browser is being fully driven by a human. If you need the flexibility to issue commands manually, then drop in a Python breakpoint, and run commands from there: import pdb; pdb.set_trace() # Or "breakpoint()" Type Three: Most cloudflare checks only happen on the initial page load. And when they don't (eg. filling out a form and clicking), then disconnecting chromedriver from Chrome right after a click is often fast enough for Selenium to hide itself before the website can detect it. If cloudflare performed random checks (or was continuously looking), then it would be a problem, but so far, it appears they're only looking at specific times (first load of a website, or clicking a specific button). This, of course, is not a perfect system when you have to do more than just get through the front door of a website. (Again, things covered in https://www.youtube.com/watch?v=5dMFI3e85ig) |
Beta Was this translation helpful? Give feedback.
One: SeleniumBase automatically opens links in new tabs if there's bot-detection software on those websites. (It checks first). There are additional methods for that: (Covered in this video: https://www.youtube.com/watch?v=5dMFI3e85ig)
Be sure to use those methods when the default behavior isn't good enough. And be sure to watch the video for details.
Two: If you directly type a URL with the keyboard into the browser's address bar, then you're going to get detected because chromedriver is still attached to Chrome. That's the primary thing that bot-detection se…