Skip to content

SeleniumBase UC Mode needs a video tutorial #2000

Closed
@mdmintz

Description

@mdmintz

SeleniumBase UC Mode needs a video tutorial

There should first be a prelude on how sites detect Selenium in general.

Then there should be an explanation on how automation frameworks can avoid being detected by websites with anti-bot services.


Key things that Selenium frameworks need to do in order to avoid getting detected:

  • Modify chromedriver to rename chromedriver-specific variables that appear in the Chrome DevTools console.
  • Launch Chrome before attaching chromedriver to it. (Don't use chromedriver to launch Chrome directly.)
  • Don't use Chrome options that are specific to Selenium (or ones that are generally only used with Selenium).
  • If using headless Chrome, make sure that you change HeadlessChrome to Chrome in the User Agent String.
  • If specifying a custom user_data_dir, make sure that the folder is never used with non-UC-Mode Chrome.
  • Disconnect chromedriver temporarily from Chrome before loading websites that try to detect chromedriver.

When all preventative measures are done correctly, Selenium should be able to enter websites appearing human:

Undetected SeleniumBase


Here are some existing examples that use --uc mode:

Here's a raw driver example:

from seleniumbase import Driver
import time

driver = Driver(uc=True)
driver.get("https://nowsecure.nl/#relax")
time.sleep(6)
driver.quit()

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions