我刚刚从http://chromedriver.chromium.org/downloads
下载了最新的chromedriver,版本为ChromeDriver 84.0.4147.30
。
但是当我试图跑步时
from bs4 import BeautifulSoup
from selenium import webdriver
browser = webdriver.Chrome()
browser.get("https://www.google.com")
它向我显示以下错误消息。
/Users/shahanurmdsharif/development/python/scrapping/venv/bin/python /Users/shahanurmdsharif/development/python/scrapping/index.py
Traceback (most recent call last):
File "/Users/shahanurmdsharif/development/python/scrapping/index.py", line 6, in <module>
browser = webdriver.Chrome()
File "/Users/shahanurmdsharif/development/python/scrapping/venv/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
RemoteWebDriver.__init__(
File "/Users/shahanurmdsharif/development/python/scrapping/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/Users/shahanurmdsharif/development/python/scrapping/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/Users/shahanurmdsharif/development/python/scrapping/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Users/shahanurmdsharif/development/python/scrapping/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 84
Process finished with exit code 1
虽然我使用的是正确的版本84.0.4147.30
。任何帮助将不胜感激。
答案 0 :(得分:1)
检查以下两项:
答案 1 :(得分:1)
嘿,您需要根据chrome浏览器版本使用确切的chrome驱动程序版本 请检查您的浏览器版本并从https://chromedriver.chromium.org/downloads下载驱动程序exe并使用它。