Skip to content

Instantly share code, notes, and snippets.

@thureos
Created December 19, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thureos/2db0bc44589669a00c22a86503c80bbb to your computer and use it in GitHub Desktop.
Save thureos/2db0bc44589669a00c22a86503c80bbb to your computer and use it in GitHub Desktop.
Selenium Remote Webdriver set Chrome User Agent
capabilities = webdriver.common.desired_capabilities.DesiredCapabilities.CHROME.copy()
capabilities['javascriptEnabled'] = True
options = webdriver.ChromeOptions()
options.add_argument('--user-agent=<YOUR USER AGENT HERE>')
driver = webdriver.Remote(command_executor='http://<YOUR SELENIUM HUB HERE>:4444/wd/hub',desired_capabilities=capabilities, options=options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment