Skip to content

Instantly share code, notes, and snippets.

@a3r0id
Last active March 21, 2022 07:24
Show Gist options
  • Save a3r0id/5b20bd86d7f8c9bee13024a65bf0412f to your computer and use it in GitHub Desktop.
Save a3r0id/5b20bd86d7f8c9bee13024a65bf0412f to your computer and use it in GitHub Desktop.
Chromedriver Automation Detection Fix

This is an awesome answer from @DebanjanB to a question on Stackoverflow.com.

options = webdriver.ChromeOptions() 
options.add_argument("start-maximized")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument('--disable-blink-features=AutomationControlled')
#...
driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment