Selenium WebDriver python bindings


I can't make python bindings for webdriver workable. Here is tutorial for installing.

easy_install webdriver

Won't find webdriver package so I have to install it manually from sources. I've downloaded source from trunk, set WEBDRIVER and PYTHONPATH variables and installed webdriver:

   ~$ cd ~
   ~$ svn checkout selenium-read-only
   ~$ cd selenium-read-only
   ~# python install
   ~$ env |grep PYT
   ~$> PYTHONPATH=:/home/ockonal/selenium-read-only/../../../firefox/lib-src:/home/ockonal/selenium-read-only/..
   ~$ env |grep WEB
   ~$> WEBDRIVER=/home/ockonal/selenium-read-only

Here is output of script.

Then I downloaded RemoteDriverServer.jar and ran it:

java -jar RemoteDriverServer.jar 8888

Now I want to include webdriver module in python script:

from selenium.firefox.webdriver import WebDriver

ImportError: No module named firefox.webdriver

7/20/2017 11:38:46 AM

Accepted Answer

Try this.

I'm guessing that selenium was installed to:


In either the site-packages or dist-packages folder.

Since the link to your output is broken I can't see the results so I'm going to make some assumptions based on a 'normal' install

One of these folders should exist:




This is the folder where the python library should exist based on the how the packages are defined in

Now go back to the folder where you downloaded the source and navigate to.


Copy the all of the source files to whichever one of these two files exist.




This is the equivalent to a 'manual install'. Although I'm not sure why you'd need to because the firefox parts of the package are clearly specified in the source.


'selenium.firefox': 'firefox/src/py',

If there is nothing for selenium under the site-packages or dist-packages folders the ' install' may not have installed correctly because it didn't have the required permissions.

Be sure to run ' install' with sudo if you haven't already. Since, root permissions are necessary to modify/add anything under '/usr'.

6/11/2010 8:37:28 AM

the latest selenium (which includes webdriver) bindings should be pip installable:

pip install selenium

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow