英文:
Unable to download chrome driver for version 115
问题
我无法下载适用于Chrome版本115的Chrome驱动程序。我已经从以下链接下载了ZIP文件:
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chrome-win64.zip
但是我无法在那里找到chromedriver.exe
文件。
我正在运行一个需要chromedriver
路径的Java-Selenium测试。我将chrome.exe
的路径复制到程序中,但它失败了,并显示错误消息Timed out waiting for driver server to start
。我是否需要chromedriver.exe
?如何获取它?
英文:
I am unable to download the Chrome driver for Chrome version 115. I have downloaded the ZIP file from:
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chrome-win64.zip
But I am unable to find the chromedriver.exe
file there.
I am running a Java-Selenium test which needs the chromedriver
path. I copied the path of chrome.exe
into the program, but it's failing and giving the error as Timed out waiting for driver server to start
. Do I need chromedriver.exe
for this? And how can I get this?
答案1
得分: 11
使用Chrome驱动程序版本114.0.5735.90,适用于Chrome版本115。对我有效。
英文:
Use chrome driver version 114.0.5735.90 for chrome version 115. It's working for me.
答案2
得分: 8
使用新的chromedriver下载网站:
https://googlechromelabs.github.io/chrome-for-testing/#stable
win32下的chromedriver的URL包含一个chromedriver.exe,您需要解压并添加到您的路径中。Selenium必须在路径中找到相同版本(115)的chromedriver和Google Chrome才能正常工作。
英文:
Use the new chromedriver download site:
https://googlechromelabs.github.io/chrome-for-testing/#stable
The URL under chromedriver for win32 holds a chromedriver.exe which you have to unpack and add to your path. Both chromedriver and Google Chrome of the same version (115) must be found in path by Selenium to work.
答案3
得分: 5
以下是翻译好的部分:
"Just in case, someone is downloading programmatically in Docker.
So I had a situation, where
- I had latest chrome stable in my Dockerfile
- Using the major version from the google-chrome, I had to find out the right URL to use for downloading its corresponding chromedriver. Earlier you could use the link
https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION}
to get the latest full version, and then it was straightforward to download when you have the full version.
Now, I am using the JSON APIs from the suggested chrome-for-testing repository, and finding the URL in it using jq to match for major version and platform.
curl --silent "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" \
| jq --arg majorVersion "$CHROME_MAJOR_VERSION" -r '.channels.Stable | select(.version | startswith($majorVersion | tostring)).downloads.chromedriver[] | select(.platform == "linux64") | .url' \
| xargs curl -L --show-error --silent --output chromedriver-linux64.zip
英文:
Just in case, someone is downloading programmatically in Docker.
So I had a situation, where
- I had latest chrome stable in my Dockerfile
- Using the major version from the google-chrome, I had to find out the right URL to use for downloading its corresponding chromedriver. Earlier you could use the link
https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION}
to get the latest full version, and then it was straightforward to download when you have the full version.
Now, I am using the JSON APIs from the suggested chrome-for-testing repository, and finding the URL in it using jq to match for major version and platform.
curl --silent "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" \
| jq --arg majorVersion "$CHROME_MAJOR_VERSION" -r '.channels.Stable | select(.version | startswith($majorVersion | tostring)).downloads.chromedriver[] | select(.platform == "linux64") | .url' \
| xargs curl -L --show-error --silent --output chromedriver-linux64.zip
答案4
得分: 4
这是115版本的ChromeDriver的链接:https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win32/chromedriver-win32.zip
英文:
Here is the link to the chromedriver for 115 version: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win32/chromedriver-win32.zip
答案5
得分: 3
解决方法非常简单。使用Selenium 4.10.0。
我们之前使用WebDriverManager来管理驱动程序,但自从Chrome升级到版本115后,WebDriverManager无法找到新的chromedriver,因为URL发生了变化。
我们只需移除WebDriverManager,让Selenium Manager来处理驱动程序,现在一切都正常工作了。
需要注意的是,Selenium正在下载chromedriver 114来用于Chrome 115。但至少我们不再受阻。
英文:
The solution is really easy for this one. Use Selenium 4.10.0.
We were using WebDriverManager for driver management and since Chrome updated to version 115, WebDriverManager was unable to find the new chromedriver due to the change in the URL.
We simply removed WebDriverManager and let Selenium Manager handle the drivers, and it is now working perfectly fine.
One thing to note is that Selenium is downloading chromedriver 114 for Chrome 115. But at least we are not blocked anymore.
答案6
得分: 1
如果您查看ChromeDriver - Chrome的WebDriver - 下载页面,您会发现最新发布的ChromeDriver版本是ChromeDriver 114.0.5735.90。
因此,如果您使用的是Chrome版本115或更高版本,您需要检查Chrome测试可用性仪表板,该仪表板提供了方便的JSON端点以下载特定的ChromeDriver版本。
Selenium Manager
随着Selenium _v4.6_及以上版本的可用性,您无需显式下载ChromeDriver、GeckoDriver或任何浏览器驱动程序,而是使用webdriver_manager。您只需确保所需的浏览器客户端,即[tag:google-chrome]、[tag:firefox]或[tag:microsoft-edge]已安装。
Selenium Manager是与[tag:selenium4]集成的新工具,可帮助获取可用于运行Selenium的工作webdriver版本。Selenium Manager的Beta 1版本将为Chrome、Firefox和Edge配置浏览器驱动程序,如果它们不在_PATH_中,则会配置浏览器驱动程序。
解决方案
作为解决方案,您可以简单地执行以下操作:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.google.com/")
tl; dr
Chrome for Testing:可靠的浏览器自动化下载
英文:
If you look at the ChromeDriver - WebDriver for Chrome - Downloads page you will find the last version of ChromeDriver to be published was ChromeDriver 114.0.5735.90.
So if you are using Chrome version 115 or newer you have to check the Chrome for Testing availability dashboard which provides convenient JSON endpoints for specific ChromeDriver version downloading.
Selenium Manager
With the availability of Selenium v4.6 and above you don't need to explicitly download ChromeDriver, GeckoDriver or any browser drivers as such using webdriver_manager. You just need to ensure that the desired browser client i.e. [tag:google-chrome], [tag:firefox] or [tag:microsoft-edge] is installed.
Selenium Manager is the new tool integrated with [tag:selenium4] that would help to get a working webdriver version to run Selenium out of the box. Beta 1 of Selenium Manager will configure the browser drivers for Chrome, Firefox, and Edge if they are not present on the PATH
.
Solution
As a solution you can simply do:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.google.com/")
tl; dr
Chrome for Testing: reliable downloads for browser automation
答案7
得分: 1
为在Docker中安装最新的Chrome和Chromedriver:
# 安装最新的Chrome
RUN CHROME_URL=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels.Stable.downloads.chrome[] | select(.platform == "linux64") | .url') \
&& curl -sSLf --retry 3 --output /tmp/chrome-linux64.zip "$CHROME_URL" \
&& unzip /tmp/chrome-linux64.zip -d /opt \
&& ln -s /opt/chrome-linux64/chrome /usr/local/bin/chrome \
&& rm /tmp/chrome-linux64.zip
# 安装最新的Chromedriver
RUN CHROMEDRIVER_URL=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels.Stable.downloads.chromedriver[] | select(.platform == "linux64") | .url') \
&& curl -sSLf --retry 3 --output /tmp/chromedriver-linux64.zip "$CHROMEDRIVER_URL" \
&& unzip -o /tmp/chromedriver-linux64.zip -d /tmp \
&& rm -rf /tmp/chromedriver-linux64.zip \
&& mv -f /tmp/chromedriver-linux64/chromedriver "/usr/local/bin/chromedriver" \
&& chmod +x "/usr/local/bin/chromedriver"
根据 https://chromedriver.chromium.org/downloads/version-selection,截至版本115,Google已更改了Chrome和Chromedriver的发布流程。有多个 JSON端点 可以用来获取最新稳定版本的Chrome和Chromedriver。
英文:
To install the latest Chrome and Chromedriver in Docker:
# Install latest Chrome
RUN CHROME_URL=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels.Stable.downloads.chrome[] | select(.platform == "linux64") | .url') \
&& curl -sSLf --retry 3 --output /tmp/chrome-linux64.zip "$CHROME_URL" \
&& unzip /tmp/chrome-linux64.zip -d /opt \
&& ln -s /opt/chrome-linux64/chrome /usr/local/bin/chrome \
&& rm /tmp/chrome-linux64.zip
# Install latest chromedriver
RUN CHROMEDRIVER_URL=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels.Stable.downloads.chromedriver[] | select(.platform == "linux64") | .url') \
&& curl -sSLf --retry 3 --output /tmp/chromedriver-linux64.zip "$CHROMEDRIVER_URL" \
&& unzip -o /tmp/chromedriver-linux64.zip -d /tmp \
&& rm -rf /tmp/chromedriver-linux64.zip \
&& mv -f /tmp/chromedriver-linux64/chromedriver "/usr/local/bin/chromedriver" \
&& chmod +x "/usr/local/bin/chromedriver"
According to https://chromedriver.chromium.org/downloads/version-selection as of version 115 Google has changed the release process for Chrome and Chromedriver. There are multiple JSON endpoints that you can probe for latest stable version of both Chrome and Chromedriver.
答案8
得分: 0
Selenium Manager现在已完全包含在selenium
4.10.0
中,所以这是你所需要的(对于Python):
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
# ...
driver.quit()
如果在系统PATH上找不到驱动程序,Selenium Manager将自动下载它。
您还可以使用此端点找到特定版本的驱动程序:https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json
如果您想知道为什么现在看到ChromeDriverManager
的错误,那是因为https://chromedriver.chromium.org/downloads仅支持版本114,这是由于Chromium团队为新的Chrome-for-Testing进行了驱动程序重构所致。
英文:
Selenium Manager is now fully included with selenium
4.10.0
, so this is all you need (for Python):
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
# ...
driver.quit()
If the driver isn't found on your system PATH, Selenium Manager will automatically download it.
You can also find a specific driver for a particular milestone with this endpoint: https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json
If you're wondering why you're now seeing this error for ChromeDriverManager
, it's because https://chromedriver.chromium.org/downloads only goes up to version 114 due to driver restructuring by the Chromium Team for the new Chrome-for-Testing.
答案9
得分: 0
我在 macOS 上遇到了相同的问题。
selenium-webdriver 4.10.0,从未更改过。
我的 Chrome 已经是最新版本,并且路径也是相同的。所以这似乎是与最近版本的 Selenium 有关。
英文:
I am finding the same on macOS.
selenium-webdriver 4.10.0, which never changed.
My Chrome is up-to-date and is in the same path. So this seems to be with a recent version of Selenium.
答案10
得分: 0
这个问题的解决方案非常简单。使用Selenium 4.9.0的稳定版本。
在这个版本中,不需要下载chromedriver.exe文件。在这个版本中,Selenium Manager处理驱动程序,现在完全正常工作。
英文:
The solution is really easy for this one. Use Selenium 4.9.0. stable version.
In this version, there isn't any need to download the chromedriver.exe file. In this version, Selenium Manager handles the drivers, and it is now working perfectly fine.
答案11
得分: 0
你可以检查Selenium Manager是否正确找到了你的浏览器和驱动程序,使用以下命令:
$ ./VS/packages/Selenium.WebDriver.4.11.0/manager/windows/selenium-manager.exe --browser chrome
INFO 驱动程序路径: C:\%USER%\.cache\selenium\chromedriver\win6415.0.5790.170\chromedriver.exe
INFO 浏览器路径: C:\Program Files\Google\Chrome\Application\chrome.exe
这是我的开发环境的输出,但在运行程序的环境中,这并不起作用,自动下载失败,因为这些URL在我的公司网络上被阻止:
对于Chrome,如果你正在使用Selenium.WebDriver.ChromeDriver,那么你只需要将这些驱动程序添加到你的PATH
中,上述命令应该能够找到驱动程序。此外,你需要安装与驱动程序兼容的正确浏览器版本。
英文:
You can check if Selenium Manager finds your browser and the driver correctly with:
$ ./VS/packages/Selenium.WebDriver.4.11.0/manager/windows/selenium-manager.exe --browser chrome
INFO Driver path: C:\%USER%\.cache\selenium\chromedriver\win645.0.5790.170\chromedriver.exe
INFO Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe
This is the output from my development environment, but on the runners this didn't work and the automatic download failed, because those URLs are blocked on my companies network:
For chrome, if you are using Selenium.WebDriver.ChromeDriver then you just need to add this packages drivers to your PATH
and the above command should find the driver. Additionally, you need to install the correct browser version compatible with the driver.
答案12
得分: 0
尝试使用win32链接而不是win64。
win32包含了Chromedriver,可以解决你的问题。
英文:
Try using the link for win32 instead of win64.
win32 contains the Chromedriver and will solve your issue.
答案13
得分: -1
如果您使用4.10.0版本的Selenium,则不会出现此问题。但是对于Chrome二进制文件的问题,此链接将有所帮助:
> ## 问题
>
> org.openqa.selenium.WebDriverException: 未知错误:无法找到Chrome二进制文件
>当前,Chromedriver宣布了一些更改。以下是完整的详细信息。之后,会出现很多问题。
>
> ## 解决方案
> 以下是Mac用户(使用Selenium 4.10.0的用户)的快速修复方法:
>
> ChromeOptions options = new ChromeOptions();
> options.setBinary("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
> WebDriver driver = new ChromeDriver(options);
>
> 在Mac上,机器错误是由二进制文件引起的。
> 指定二进制文件路径后,这将起作用!
英文:
If you use the 4.10.0 Selenium version then this issue will not come. But for the chrome binary issue, this link will help:
> ## Issue
>
> org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
>Currently, there was some change announced by
> Chromedriver. Here are the complete details. After that, So many
> issues are coming.
>
> ## Solution
> Below is the quick fix for Mac users (Who are using Selenium 4.10.0)
>
> ChromeOptions options = new ChromeOptions();
> options.setBinary("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
> WebDriver driver = new ChromeDriver(options);
>
> In Mac, machine error is due to the binary.
> After specifying the binary path this will work!!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论