WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome 在使用Python中的Selenium库与较旧版本的Google Chrome时,出现了WebDriverException: 未知错误: 找不到Chrome二进制文件的错误。

4 浏览
0 Comments

WebDriverException: unknown error: cannot find Chrome binary error with Selenium in Python for older versions of Google Chrome 在使用Python中的Selenium库与较旧版本的Google Chrome时,出现了WebDriverException: 未知错误: 找不到Chrome二进制文件的错误。

由于兼容性原因,我更喜欢使用Chrome版本55.0.2883.75和Chromedriver v. 2.26。我从https://www.slimjet.com/chrome/google-chrome-old-version.php下载了旧版本的Chrome,从https://chromedriver.storage.googleapis.com/index.html?path=2.26/下载了Chromedriver 2.26。

我使用以下代码尝试设置我的Chrome二进制文件位置:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.binary_location = "C:\\Program Files\\Chrome\\chrome64_55.0.2883.75\\chrome.exe"
driver = webdriver.Chrome('chromedriver.exe', chrome_options = options)

然而,当我尝试启动WebDriver时,Python返回以下错误:

WebDriverException: 未知错误:无法找到Chrome二进制文件
(Driver info: chromedriver=2.26.436362
(5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 10.0.14393 x86_64)

我尝试搜索类似的问题和答案,但到目前为止还没有找到任何解决办法。

0