1

Im trying to use selenium in python 2.7 and when trying to import webdriver it gives me the error "ImportError: cannot import name webdriver" Ive had a search around and people seem to say updating it should sort the problem which i have tried using "pip install -U Selenium" which responds saying it is already upto date.

This is the full reply i get when running my script:

Traceback (most recent call last):
    File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
    line   326, in RunScript
        exec codeObject in __main__.__dict__
    File "C:\Python27\selenium.py", line 1, in <module>
        from selenium import webdriver
    File "C:\Python27\selenium.py", line 1, in <module>
        from selenium import webdriver
ImportError: cannot import name webdriver    
1

1 Answer 1

2

I think looking at what you have (although python is pretty far down my known languages list) that the problem is related to the wrong selenium being imported. Have a look at:

Trying to use Selenium 2 with Python bindings, but I'm getting an import error

Sign up to request clarification or add additional context in comments.

2 Comments

realized that i stupidly called my script selenium.py which seems to of been causing the error
I bet you are far from the first person to do that!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.