Modern Web Automation With Python and Selenium

SeleniumAutomation TestingTesting Tools

We can have modern web automation with Python and Selenium. To configure with Selenium webdriver in Python the steps described below need to be followed −

Step1 −To install Python in our system, visit the link −

Step 2 − Click on the Download Python <version number> button. Once the download is completed, the Python executable file should be available in our system.

Step 3 − Double-click on this executable file and the Python installation landing page should be opened. Click on Install Now.

Step 4 − Python should be available in the below path −


Step 5 − We shall configure the path of the folders - Python and Scripts (introduced within the Python folder) in the Environment variables for the Windows users.

Step 6 − To verify, Python has been installed, run the command: python --version. The Python version should get displayed.

Step 7 − Selenium bindings installation can be done by executing the command: pip install selenium.

Step 8 − A folder called Selenium should be found within the Python folder. To update the Selenium existing version, run the command: pip install –U selenium.

Step 9 − Finally, we should also have a Python editor - PyCharm to create the Selenium scripts((

Step 10 − To launch the Selenium script in a browser, we also need to download the browser drivers. For this, visit the below link −

Step 11 − Scroll down to the Browser section and to download the browser drivers for different browsers.


Code Implementation

from selenium import webdriver
#configure chromedriver path
driver = webdriver.Chrome(executable_path='../drivers/chromedriver')
#implicit wait
#url launch
print('Page title: ' + driver.title)
#browser close


Updated on 29-Jun-2021 08:28:31