When I started with Selenium in Python my biggest problem was the webdriver issue which I later found that there is an automatic download option in python using some special package.
The webdriver sometimes not compatible with the browser you are using. You have to manually find them from the official websites. This is messy part of selenium, I think.
We can get ride off this problem using webdriver_manager
first you need to install the Python package using pip
pip install webdriver_manager
Now you can use it in your project
from webdriver_manager.chrome import ChromeDriverManager from webdriver_manager.firefox import GeckoDriverManager driver = webdriver.Chrome(executable_path=ChromeDriverManager().install()) driver = webdriver.Firefox(executable_path=GeckoDriverManager().install())
The package will automatically check for compatible version and install it and no more worries about web driver and scrap the web with ease and peace.