Running Selenium WebDriver script without installing the Selenium driver client for python will cause the python interpreter complain that no module named selenium was found.
Traceback (most recent call last):
File "test.py", line 1, in <module>
from selenium import selenium
ImportError: No module named selenium
The following steps will help you to solve the issue.
- Download the Selenium Client Drivers for Python. Current version while i am posting this tutorial is version 2.28.0 – selenium-2.28.0.tar.gz
- Unzip the file and browser to the following folder – \selenium-2.28.0.tar\dist\selenium-2.28.0\py\
- Copy the selenium folder. Yes, copy the entire folder.
- Browse to the python folder – C:\Python27\Lib\. I am using python 2.7, you might have different version. That’s OK.
- Paste the selenium folder you’ve copied just now to the Lib folder and you are done.
It should work now if you try to import selenium.