Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
681 views
in Technique[技术] by (71.8m points)

python - 'unresolved reference Error' 'from webdriver_manager.chrome import ChromeDriverManager

I am creating an application that shall interact with websites, the important code is listed below. So when it comes to importing 'ChromeDriverManager' from 'webdriver_manager.chrome' I get the Error "unresolved reference 'webdriver_manager'" and "unresolved reference'ChromeDriverManager'". The problem is that I want to autoupdate the chromedriver and this was the solution I came up with but it won't work when running it in pycharm but when I run it from the console it would work...does anyone have a solution on this because I prefer to test out my code in pycharm than starting it from the console every time.

from selenium import webdriver 
from webdriver_manager.chrome import ChromeDriverManager # important for chromedriver-autoinstall
import time
p= ChromeDriverManager()
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("useAutomationExtension", False)
chrome_options.add_experimental_option("excludeSwitches", ["enable-logging", "enable-automation"])
# disables 'Browser is managed by test software' and surpresses error with USB device
driver = webdriver.Chrome(executable_path=p.install(), options=chrome_options)
# see above + install right version of chromedriver
t = 2  # time to wait for input of number
i = 1  # current round
duration = 1    
question from:https://stackoverflow.com/questions/65940622/unresolved-reference-error-from-webdriver-manager-chrome-import-chromedriverm

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...