硒的问题
回溯(最近通话最近一次):
File "C:/Users/SONY/PycharmProjects/untitled/bot_test.py", line 3, in <module>
driver = webdriver.Chrome()
File "C:\Users\SONY\Anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "C:\Users\SONY\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\SONY\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\SONY\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\SONY\Anaconda3\lib\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 79
答案 0 :(得分:1)
错误表明您为chromedriver
版本使用了不兼容的chrome
。请从https://chromedriver.chromium.org/downloads
chromedriver
版本匹配的Chrome
版本
答案 1 :(得分:-1)
您的 ChromeDriver 与 chrome浏览器
不兼容检查您的Chrome浏览器版本,然后从this网站下载chrome驱动程序。
并在代码中设置chrome驱动程序的路径
from selenium import webdriver
driver=webdriver.Chrome('E:\\Om\\selenium\\chromedriver.exe')
您需要提供chrome驱动程序的路径。
步骤:-