首页 > 其他分享 >'chromedriver' executable needs to be in PATH

'chromedriver' executable needs to be in PATH

时间:2023-02-28 12:13:12浏览次数:57  
标签:executable exe 浏览器 Chrome chromedriver PATH

报错信息如下:
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

image

解决方案

1、下载与浏览器对应版本的chromedriver

下载地址:https://registry.npmmirror.com/binary.html?path=chromedriver/
image

image

2、解压得到chromedriver.exe文件

image

3、chromedriver.exe拷贝到指定文件中

1)将chromedriver.exe文件拷贝至谷歌浏览器目录(如 C:\Program Files\Google\Chrome\Application)

2)将chromedriver.exe拷贝至python根目录(C:\Python38)

3)将谷歌浏览器环境变量添加到Path(C:\Users\Administrator\AppData\Local\Google\Chrome\Application)

注:第3步忽略也可行,以上步骤中的路径对照自己电脑路径


chromedriver与浏览器不一致的问题

This version of ChromeDriver only supports Chrome version 105

1、查看Chrome的版本号
1)Chrome浏览器中点击右上角三个点->帮助->关于Google Chrome

image

2)下图中表示Chrome的版本号

image

2、下载与Chrome对应的chromedriver版本替换

image

标签:executable,exe,浏览器,Chrome,chromedriver,PATH
From: https://www.cnblogs.com/lc-blogs/p/17163561.html

相关文章