3

I wanted to code a program with selenium, so I wanted to test it but:

from selenium import webdriver

When Im running this program, it says:

ImportError: cannot import name 'webdriver' from 'selenium'
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Blockzii
  • 37
  • 2
  • 4
  • 1
    Does this answer your question? [Selenium using Python - Geckodriver executable needs to be in PATH](https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path) – Nemanja Aug 16 '20 at 20:37

1 Answers1

2

This error message...

ImportError: cannot import name 'webdriver' from 'selenium'

...implies that there was an ImportError when you tried to import webdriver from the selenium module.


Reason

This ImportError is observed when you try to execute the line:

from selenium import webdriver

without installing Selenium.


Solution

The very first step to use Selenium will be to install Selenium Python bindings using the following command:

pip install -U selenium

or upgrade Selenium Python bindings using the following command:

pip install -U selenium

Reference

You can find a couple of relevant discussions in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352