Menu Close

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

selenium installation
Rate this post

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.

Suggested Blog Posts

1 Comment

Leave a Reply

Your email address will not be published.