There is an automated way to get gecko driver
binary download etc with webdrivermanager
api. This package downloads binaries/executables in an automated way and helps us to avoid all the manual steps that we do previously related to drivers to run our tests.
How do we use this in our project?
Only setup required is to install this package using ‘pip’.
pip install webdriver_manager
For Firefox
from webdriver_manager.firefox import GeckoDriverManager
from selenium import webdriver
driver = webdriver.Firefox(executable_path=GeckoDriverManager().install())
driver.get("http://www.google.com/")
print driver.title
driver.quit()
You can check more details here about set up and use. Pypi docs for webdrivermanager