Last active
May 1, 2020 13:31
-
-
Save chris-lovejoy/b982bc77f389ff73e15991d000c1ac71 to your computer and use it in GitHub Desktop.
initiate driver
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 initiate_driver(location_of_driver, browser): | |
if browser == 'chrome': | |
driver = webdriver.Chrome(executable_path=(location_of_driver + "/chromedriver")) | |
elif browser == 'firefox': | |
driver = webdriver.Firefox(executable_path=(location_of_driver + "/firefoxdriver")) | |
elif browser == 'safari': | |
driver = webdriver.Safari(executable_path=(location_of_driver + "/safaridriver")) | |
elif browser == 'edge': | |
driver = webdriver.Edge(executable_path=(location_of_driver + "/edgedriver")) | |
return driver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment