Created
May 22, 2022 04:10
-
-
Save gaganmanku96/861f9b95c9e80c725aa80eac9f2f13e1 to your computer and use it in GitHub Desktop.
Initializing a remote driver of selenium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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