[英]“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 webdrivermanager可能是webdrivermanager中的一个错误
To install the latest version of ChromeDriver you can use:要安装最新版本的ChromeDriver ,您可以使用:
brew tap homebrew/cask && brew cask install chromedriver
使用 Homebrew 的 Mac 用户: brew tap homebrew/cask && brew cask install chromedriver
sudo apt-get install chromium-chromedriver
Debian 基于 Linux 发行版: sudo apt-get install chromium-chromedriver
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
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.