3

I am trying to work with selenium module for Python but somehow keep running into an error. I have already installed selenium successfully. I am working with Python 2.7.10. I have viewed other posts on Stack Overflow but nothing coordinates with my scenario. Please provide your advice on this matter.

pip install selenium

Attached is my script and the error.

from selenium import webdriver

driver = webdriver.Chrome()
driver.get("https://etrakit.friscotexas.gov/Search/permit.aspx")

Error:

from selenium import webdriver
ImportError: cannot import name webdriver
  • is selenium installed? run `pip list | grep -i selenium` to check – matias elgart Nov 21 '16 at 21:22
  • Yes it is, to be precise, selenium <3.0.1>. –  Nov 21 '16 at 21:23
  • 2
    Maybe you have a file 'selenium.py'? – Konstantin Nov 21 '16 at 21:26
  • i just created my own virtualenv, installed selenium 3.0.1 and ran your script and it found webdriver fine. instead it complained that selenium wasn't configured correctly with an executable, which is correct since i haven't done that. did you use a virtualenv when you installed selenium? more info needed about your specific environment – matias elgart Nov 21 '16 at 21:26
  • Sounds like you called your file `selenium.py`. Don't do that. – user2357112 Nov 21 '16 at 21:28
  • Do you have chromedriver.exe on the folder where your script is on? – JChris Nov 21 '16 at 21:34
  • Yes I saved this file as selenium.py. Could that be the issue here? –  Nov 21 '16 at 21:40
  • Even after deleting selenium.py and starting a new file and naming it aspxscraping.py it shows an error. from selenium import webdriver File "C:/Users/jose/Desktop/Programming\selenium.py", line 1, in ImportError: cannot import name webdriver –  Nov 21 '16 at 21:46
  • 1
    @Learner follow the linked question dear. There'll be pyc files that you need to delete. The dupe answers all your concerns elegantly. – Bhargav Rao Nov 21 '16 at 21:49

0 Answers0