I'm trying to build an app with python and I need it to interface with the web. I'm trying to use selenium for this but I keep getting this error.
Here's the code I'm using.
# selenium for web driving
import selenium
# SELENIUM & WEBDRIVER
# importing webdriver manager for python. selenium needs this
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType
driver = webdriver.Chrome(service=Service(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))
And the error I'm getting:
C:\Users\myname\Miniconda3\python.exe "//this.is.a.netword.drive/ulappa$/myname/Testiympäristö/OAMK kurssi/downloader.py"
Traceback (most recent call last):
File "\\this.is.a.netword.drive\ulappa$\myname\Testiympäristö\OAMK kurssi\downloader.py", line 15, in <module>
from webdriver_manager.chrome import ChromeDriverManager
ModuleNotFoundError: No module named 'webdriver_manager'
Process finished with exit code 1
How do I fix this? I've installed selenium and webdriver-manager in cmd.
CodePudding user response:
Are you using the correct python environment? Do you have multiple python instances installed?
CodePudding user response:
You might need to change the set up import (from webdriver_manager.core.utils import...
) :
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType
driver = webdriver.Chrome(options=options, service=Service(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))