Skip to content

Instantly share code, notes, and snippets.

@gaganmanku96
Created May 22, 2022 04:10
Show Gist options
  • Save gaganmanku96/861f9b95c9e80c725aa80eac9f2f13e1 to your computer and use it in GitHub Desktop.
Save gaganmanku96/861f9b95c9e80c725aa80eac9f2f13e1 to your computer and use it in GitHub Desktop.
Initializing a remote driver of selenium
def get_driver():
time.sleep(3)
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
driver = webdriver.Remote(
command_executor='http://headless_chrome:3000/webdriver',
options=chrome_options,
)
return driver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment