Install Python

We have to install python in our operating system to use selenium python bindings for our project.

1. Navigate to

2. Download the latest version of the Python or a stable release, for this tutorial we will be using python 3 (version above 3 are considered as 3 in general terms)

3. Install the python installer (I am on the Windows 10 operating system), and select add the path

4. After installing, open the command prompt, and type python, you should get version and >>> python editor. If you get them, then your python installation is successful.


Open Webpage in selenium python

Install Selenium python bindings

  1. We should have python installed in your system before you try to install selenium
  2. You can install selenium just by typing the following command on cmd (not on python editor) : pip install -U selenium
  3. Now open the python editor just simply entering word python on the command prompt.
  4. The below command will not throw an exception if your selenium is installed successfully
    from selenium import webdriver​
Only in case if you are not able to install the selenium using the pip command then only try the below steps otherwise ignore the below steps.
Install selenium Manually:
  1. Sometimes pip command fails to install selenium either due to proxy issues or due to system configuration issues, in that we have to use the below steps to install selenium.
  2. Navigate to
  3. Click on the download button
  4. Download the applicable format based on your operating system, below image shows for windows operating system.
  5. Extract the downloaded zipped file to your local system, and the content should look like below.
  6. Open command prompt/terminal and navigate to that the unzipped folder.
  7. Enter the following command to install selenium:
    python install or python install​

  8. Now open python editor just simply entering word python on the command prompt.
  9. The following command will not throw an exception if your selenium is installed successfully
    from selenium import webdriver.​

CSS Selector in Selenium Python

Install pyDev with eclipse

We cannot code all the things in the python editor, because as the code block increases it becomes difficult to continue with coding. To edit the python code quickly, we have to use an IDE for development. In this tutorial, I will be using Eclipse with PyDev.

PyDev is a kind of plugin for the eclipse to support the Python programming.

1. After installing Eclipse, Goto Help >Eclipse marketplace

2. Now search for "pyDev" and install the software

3. Accept the License and Restart the eclipse.
4. We have to open PyDev perspective to edit python code, Window > Perspective > Open Perspective > Other, and choose PyDev

5. Create first Project, File > New > PyDev Project

6. For the first time, we have to set the interpreter, click to configure the interpreter.

7. Click on the Auto-config option, and then finish the creating project wizard.

8. Right-click on the python project and Create a new Pydev Module, and select blank

9. Enter the following command in the coding area and Click the run button in Eclipse.

from selenium import webdriver

10. You can choose how you want to run either Just python program or as UnitTest Program

Python Selenium find the element

Console on PyDev

Unlike other programming languages, Python provides a live editor, which is you can control the browser entering command by command.

I am not talking about debugging; Debugging is a process where you will checkpoint and run the complete program step by step to understand the flow and error.

Python console gives the ability to run a live command. For example, I have opened a browser, and I Opened, but I realize I want to open, now I do not have to stop the program as I am in the live editor I just change the commands.

Let us see how to open a Live console :

1. Open the Eclipse console.

2. On the Right-hand corner, you can find an icon to like a rectangle with + sign, click it.

3. Choose PyDev Console

4. Select Console for current Editor

5. Now you have a live console and type the commands that you want to use.

Webdriver Wait in Python Selenium

    About Author :

    I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.

    Comment / Suggestion Section
    Point our Mistakes and Post Your Suggestions