D Dev Duniya
Back to Journal
3 min read

How to Install Selenium Python? | Install Selenium Webdriver- DevDuniya

Ashish Yadav

Ashish Yadav

Published on Dev Duniya
Keep exploring
Compare the details before you buy.

In this article, We are going to see how to install selenium in windows and mac and how to install selenium web driver using the command line. Before starting the selenium tutorial, lots of software should be installed in your system so that you can run the test scripts and code of selenium. So let's start this blog:

Selenium scripts are built to do little tedious obligations which may be computerized using headless internet browsers. Now, some of you may be questioning what is headless web browsers. It’s nothing but a browser that may be managed using those selenium scripts for automation(net tasks). Selenium scripts may be programmed using various languages which include python, Java, and so many.

First Install Python
Firstly you will have to install python programming for the selenium framework. If you want to know that, How to install download and install python programming on windows then click the below link
to read the complete article and follow every step to download and install python programming.
How to Install Python Programming in Windows?

Installing Python bindings for Selenium
Now open your terminal to install selenium in your system. This is the first method to install selenium:

pip install selenium

If the upper method is not working then copy the below command and run it in your command prompt:

python -m pip install selenium

Now selenium has been installed in your system successfully. But before doing the code of selenium in your system, you will have to install a selenium web driver so let's see. How to Download & Install Selenium WebDriver
Selenium requires a driver to interface with the chosen browser. Chrome, for example, requires a chrome driver, which needs to be installed before the below examples can be run.
Make sure it’s in your PATH, e. g., place it in /usr/bin or /usr/local/bin.

Steps for web driver:

  1. Download chrome web driver from the given website
  2. Now Copy the "chromedriver.exe" file and add it to your environment variable PATH
  3. Now you can use your "chromedriver.exe" file in your program

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 and we have listed below them. You can simply download the driver form given source and after that simply add the
PATH of the driver in your system environment.

Chrome: https://sites.google.com/chromium.org/driver/
Edge: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Firefox: https://github.com/mozilla/geckodriver/releases
Safari: https://webkit.org/blog/6900/webdriver-support-in-safari-10/

Now in the next article, we will see the introduction to chrome web driver and do some basic selenium coding practice.

Keep reading

12 latest articles

The newest stories from Dev Duniya, excluding the article you are reading.

All articles →

From the product catalog

Explore device specifications

Specification cards update automatically from published catalog products, grouped by brand.

Apple specifications

Explore Apple devices →
Apple Apple iPhone Duo
Apple Apple iPhone Duo specifications

Apple iPhone Duo is a new-generation iPhone model focused on a sleek design, powerful performance, and everyday usability. Explore iPhone Duo specifications, features, display, cameras, battery, and expected price in the USA. Get the latest information about Apple iPhone Duo and its key features. Compare iPhone Duo with other popular Apple iPhone models.

Size (inches)
Open: 4.64 x 6.48 x 0.21 Closed: 4.64 x 3.31 x 0.44
Weight (ounces)
8.96
Display size (inches)
Inner: 7.6-inch (diagonal) all-screen OLED folding display Outer: 5.4-inch (diagonal) all-screen OLED display
Resolution (pixels)
Inner: 1878-by-2670-pixel resolution at 430 ppi Outer: 1398-by-2034-pixel resolution at 460 ppi
See all specifications →
Apple Apple iPhone 18 Pro Max
Apple Apple iPhone 18 Pro Max specifications

Apple iPhone 18 Pro Max is a high-end flagship smartphone designed for powerful performance and advanced photography. Explore iPhone 18 Pro Max specifications, features, display, cameras, battery, and expected price in the USA. Discover the latest upgrades and key features of Apple’s largest Pro iPhone. Compare iPhone 18 Pro Max with other premium flagship smartphones.

Size (inches)
6.43 x 3.07 x 0.34
Weight (ounces)
8.78
Display size (inches)
6.9-inch (diagonal) all-screen OLED display
Resolution (pixels)
2868-by-1320-pixel resolution at 460 ppi
See all specifications →
Apple Apple iPhone 18 Pro
Apple Apple iPhone 18 Pro specifications

Apple iPhone 18 Pro is a premium flagship smartphone with advanced performance and an upgraded camera system. Explore iPhone 18 Pro specifications, features, display, cameras, battery, and expected price in the USA. Get the latest details about Apple’s new Pro model and its key upgrades. Compare iPhone 18 Pro features with other flagship smartphones.

Size (inches)
5.91 x 2.83 x 0.34
Weight (ounces)
7.44
Display size (inches)
6.3-inch (diagonal) all-screen OLED display
Resolution (pixels)
2622-by-1206-pixel resolution at 460 ppi
See all specifications →

Google specifications

Explore Google devices →

Samsung specifications

Explore Samsung devices →