1

I am creating a project to automatically open a page, and I installed Selenium, but it says that there:

no such module as webdriver_manager 

And the directory "C:\Users\Nina\chromedriver.exe" is not valid.

Here's my code:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import webdriver_manager as manager
from selenium.webdriver.common.by import By

s=Service(manager.ChromeDriverManager().install())
driver = webdriver.Chrome(service=s)
driver.maximize_window()
driver.get('https://cms.instructure.com/courses/500236/pages/week-14-november-22-23')

How can this error be fixed?

1
  • Can you update the question with the error stack trace? Commented Nov 21, 2021 at 22:11

1 Answer 1

3

This error message...

ModuleNotFoundError: No module named 'webdriver_manager' 

...implies that the webdriver_manager wasn't properly installed.


Reasons

Possibly you installed webdrivermanager as:

pip install webdrivermanager

Or you have installed webdriver-manager as:

pip install webdriver-manager

Hence you see the error.


Solution

Instead of those, you need to install webdriver_manager as:

pip3 install webdriver_manager

Update your code as:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

s=Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=s)
driver.maximize_window()
driver.get('https://cms.instructure.com/courses/500236/pages/week-14-november-22-23')

References

You can find a couple of relevant detailed discussion in:

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

Comments

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.