I have create a python script which requires the webdrive. In my code I have imported it like so, from selenium import webdriver.
I went to their website here downloaded and ran setup.py but still does not import it. I don't know if this helps but I have python 2.7, I also do not have installed pip.
3 Answers
This means that you have installed selenium package somewhere on your system, but the interpreter can not find it, either in the standard location, or the pythonpath override. Please try this in ipython or in Python2.7 shell:
import selenium
selenium.__file__
The above command statements should print out the path to the exact selenium folder that you import. If it not located in C:\Python27\Lib\site-packages (default Windows path for new package installation) then delete it or rename (if you don't really need it).
Or just download selenium from another source that installs it to the standard location.
I'm new to coding and python as a whole but I was able to figure it out. At least what was giving me trouble.
in console: import selenium
from selenium import webdriver
then I was able to run: driver= webdriver.Chrome(executable_path=r'C:\webdrivers\chromedriver.exe')
chrome driver opened.
After you get the path to the driver, for instance, you can open Chrome via:
from selenium import webdriver
path = "C:\webdrivers\chromedriver.exe"
browser = webdriver.Chrome(path)