简体   繁体   English

使用 Chrome v84 时“此版本的 ChromeDriver 仅支持 Chrome 版本 84”

[英]“This version of ChromeDriver only supports Chrome version 84” when using Chrome v84

I am trying to use Selenium to open a headless Chrome browser in Python.我正在尝试使用 Selenium 在 Python 中打开无头 Chrome 浏览器。 I am using Chrome v84 and tried both Chromedriver v84 and v83.我正在使用 Chrome v84 并尝试了 Chromedriver v84 和 v83。 I am on Mac.我在 Mac 上。

import selenium
from selenium import webdriver

path = r"path/to/chromedriver.exe"

op = webdriver.ChromeOptions()
op.add_argument('headless')
driver = webdriver.Chrome(executable_path = path, options=op)

I also tried this:我也试过这个:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

op = webdriver.ChromeOptions()
op.add_argument('headless')
driver = webdriver.Chrome(ChromeDriverManager().install(), options=op)

It returned:它返回:

ValueError: There is no such driver by url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282

I also attempted to add Chromedriver to PATH and could check it was there by echo $PATH , but it did not work.我还尝试将 Chromedriver 添加到 PATH 并可以通过echo $PATH检查它是否存在,但它不起作用。

I also tried running brew cask upgrade chromedriver , after installing Chromedriver via homebrew, but it would only install Chromedriver v83 and the update command would only return something like "no updates available".在通过自制程序安装 Chromedriver 后,我还尝试运行brew cask upgrade chromedriver ,但它只会安装 Chromedriver v83,并且更新命令只会返回“无可用更新”之类的内容。

I also tried adding the path of Chromedriver under /usr/local/bin by running sudo nano /etc/paths in the terminal.我还尝试通过在终端中运行sudo nano /etc/paths/usr/local/bin下添加 Chromedriver 的路径。 Unfortunately, this time it didn't show up when running echo $PATH , and as expected the Python script did not run successfully.不幸的是,这一次运行echo $PATH时它没有出现,并且正如预期的那样 Python 脚本没有成功运行。

Any help regarding this will be greatly appreciated.对此的任何帮助将不胜感激。

Try '--headless' instead of 'headless' and also '--disable-gpu':尝试使用 '--headless' 而不是 'headless' 以及 '--disable-gpu':

op.add_argument('--headless')

op.add_argument('--disable-gpu')

If you are using Chrome v84 check too if the ChromeDriverManager version you are using match.如果您使用的是 Chrome v84,请检查您使用的 ChromeDriverManager 版本是否匹配。 That error is about unmatched versions between driver and python code interface.该错误与驱动程序和 python 代码接口之间的不匹配版本有关。

This error message...此错误消息...

ValueError: There is no such driver by url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282

...implies that the your program tried to download and install the ChromeDriver from the url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282 which is incorrect. ...暗示您的程序试图从 url http://chromedriver.storage.googleapis.com/LATEST_RELEASE_64.0.3282下载并安装ChromeDriver ,这是不正确的。

The correct url is:正确的 url 是:

https://chromedriver.storage.googleapis.com/LATEST_RELEASE

which returns:返回:

84.0.4147.30

Possibly a bug in 可能是中的一个错误


Quick installation of the latest ChromeDriver 快速安装最新的 ChromeDriver

To install the latest version of ChromeDriver you can use:要安装最新版本的ChromeDriver ,您可以使用:

  • Mac users with Homebrew : brew tap homebrew/cask && brew cask install chromedriver使用 Homebrew 的 Mac 用户brew tap homebrew/cask && brew cask install chromedriver
  • Debian based Linux distros : sudo apt-get install chromium-chromedriver Debian 基于 Linux 发行版sudo apt-get install chromium-chromedriver
  • Windows users with Chocolatey installed : choco install chromedriver Windows 安装 Chocolatey 的用户choco install chromedriver

You can find a detailed iscussion in session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium您可以在session not created: This version of ChromeDriver only support Chrome version 74 error with ChromeDriver Chrome using Selenium


tl; tl; dr博士

However since yesterday (Jul 15, 2020) https://chromedriver.storage.googleapis.com/LATEST_RELEASE returned:然而,从昨天(2020 年 7 月 15 日) https://chromedriver.storage.googleapis.com/LATEST_RELEASE返回:

83.0.X

Which was incorrect.这是不正确的。 @John Chen ensured that we have fixed that now. @John Chen确保我们现在已经解决了这个问题。

Snapshot:快照:

最新发布的

Hi you need to use exact driver exe accourding web browser version.您好,您需要使用符合 web 浏览器版本的确切驱动程序 exe。 go to your browser -->about section and check version of chrome then you can download driver.exe in https://chromedriver.chromium.org/downloads this link go 到您的浏览器 -->about 部分并检查 chrome 的版本,然后您可以在https://chromedriver.chromium.org/下载此链接中的 driver.exe

(Browser version are updating time to time so you need to update your driver versions) (浏览器版本会不时更新,因此您需要更新驱动程序版本)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SessionNotCreatedException:此版本的 ChromeDriver 仅支持 Chrome 版本 84 使用 ChromeDriver 和 Chrome 通过 Selenium 和 Python - SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 84 using ChromeDriver and Chrome through Selenium and Python 此版本的 ChromeDriver 仅支持 Chrome 102 版本 - This version of ChromeDriver only supports Chrome version 102 SessionNotCreatedException:消息:session 未创建:此版本的 ChromeDriver 仅支持使用 Selenium ChromeDriver v81 的 Chrome 版本 81 - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81 using Selenium ChromeDriver v81 SessionNotCreatedException:消息:会话未创建:此版本的 ChromeDriver 仅支持使用 ChromeDriver 和 Chrome 的 Chrome 版本 87 - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 87 using ChromeDriver and Chrome Python selenium - session not created: This version of ChromeDriver only supports Chrome version 86 using ChromeDriver and Chrome with Selenium - Python selenium - session not created: This version of ChromeDriver only supports Chrome version 86 using ChromeDriver and Chrome with Selenium selenium ChromeDriver 仅支持 Chrome 版本 91 - selenium ChromeDriver only supports Chrome version 91 appium python报错:此版本ChromeDriver仅支持Chrome 83版 - appium python error:This version of ChromeDriver only supports Chrome version 83 此版本的 ChromeDriver 仅支持 Chrome 79 版 - Python - This version of ChromeDriver only supports Chrome version 79 - Python session 未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 88 - session not created: This version of ChromeDriver only supports Chrome version 88 Selenium报错:这个版本的ChromeDriver只支持Chrome 83版? - Selenium error: This version of ChromeDriver only supports Chrome version 83?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM