Skip to content

Instantly share code, notes, and snippets.

@chris-lovejoy
Last active May 1, 2020 13:31
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 chris-lovejoy/b982bc77f389ff73e15991d000c1ac71 to your computer and use it in GitHub Desktop.
Save chris-lovejoy/b982bc77f389ff73e15991d000c1ac71 to your computer and use it in GitHub Desktop.
initiate driver
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