Home > Back-end >  I can't open selenium in vscode
I can't open selenium in vscode

Time:09-21

This is my code:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()
driver.get("http://www.python.org")

I just tried to test, but it is printing the same things.

Traceback (most recent call last):
  File "C:\python\selenium\google.py", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
PS C:\python\selenium> 

I installed selenium, but it isn't operating. What should I do?

CodePudding user response:

No module named 'selenium' means you haven't installed selenium. So first run pip install selenium.

CodePudding user response:

ModuleNotFoundError: No module named 'selenium'

this error means there's no Selenium installed.

See here to check how to install Selenium.

Python

Installation of Selenium libraries for Python can be done using pip:

pip install selenium

Alternatively you can download the PyPI source archive (selenium-x.x.x.tar.gz) and install it using setup.py:

python setup.py install
  • Related