How to install selenium for Python

Install selenium via pip:

pip install selenium


Selenium requires a driver to interface with the chosen browser. For example, Google Chrome requires chromedriver to be installed before running selenium programs. Download the zip file according to your web browser and extract the zip file. You will get a .exe file on extracting the zip. Make sure to keep the .exe file within the same folder where you are going to write the selenium code.

Failure to observe this step will give you an error selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH.

Other supported browsers will have their own drivers available. Links to some of the more popular browser drivers follow.