Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'webdriver' from 'selenium' error using Selenium and WebDriver through Python

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'
like image 207
Blockzii Avatar asked Feb 14 '26 16:02

Blockzii


1 Answers

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:

  • Python : no module named selenium
  • Could not find a version that satisfies the requirement selenium; No matching distribution found for selenium while installing Selenium on Python3.6.5
like image 80
undetected Selenium Avatar answered Feb 17 '26 04:02

undetected Selenium



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!