I've just installed Selenium (I'm that new to it) for Python using
sudo -H pip install selenium
and at the following command
from selenium.webdriver import Firefox
I get
No module named webdriver
Any thoughts?
Check if site packages link is added in system environment variables;
C:\Python27\Lib\site-packages;
On windows start, type environment variables. Click on the "Edit the system environment variables" . Click -> Environment variables -> Under System Variables-> Scroll down to find "Path" -> Edit and add above path.
first you need to import
from selenium import webdriver
then you can use other imports
from selenium.webdriver import Firefox you should use it as driver = Firefox()! It's normal that you cannot call it as webdriver.Firefox() as you import Firefox class separately from webdriver module
import seleniumand check whetherselenium.__file__points to correct folder that actually containswebdriver?import seleniumalso result in an error?sudo -Hflag. I never needed to use it.