我在执行这段代码时遇到了问题:
from selenium import webdriver
import time
browser = webdriver.Chrome(r'C:\Users\XXXXX\chromedriver.exe') #Path directory
browser.get('https://www.google.com')问题在于路径文件夹:
SessionNotCreatedException: Message: session not created: This version of
ChromeDriver only supports Chrome version 101
Current browser version is 100.0.4896.60 with binary path C:\Program
Files\Google\Chrome\Application\chrome.exe有什么建议吗?
发布于 2022-04-04 14:57:28
第一期:
错误
ChromeDriver only supports Chrome version 101
解决方案
ChromeDriver和Chrome版本必须匹配。看看医生们。因此,请确保安装了匹配的版本。
第二期
错误
'C:\Program Files\Google\Chrome\Application\chromedriver.exe' executable needs to be in PATH
解决方案
您需要将变量设置为在操作系统(即Windows )中包括C:\Program Files\Google\Chrome\Application\chromedriver.exe。PATH变量定义了操作系统搜索可执行文件的路径。请参阅这条线,了解如何在Windows 10中设置环境变量。但是,您只需在谷歌上设置PATH变量,就可以找到大量的教程。
https://stackoverflow.com/questions/71718594
复制相似问题