gpt4 book ai didi

python - 值错误 : There is no such driver by url (chromedriver_mac64_m1. zip)

转载 作者:行者123 更新时间:2023-12-03 08:01:22 33 4
gpt4 key购买 nike

我正在使用 Selenium 运行脚本,但就在几天前,我开始收到以下错误:

line 86, in <module> ChromeDriverManager().install()), options=opt)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/webdriver_manager/chrome.py", line 38, in install
driver_path = self._get_driver_path(self.driver)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/webdriver_manager/core/manager.py", line 31, in _get_driver_path
file = self._download_manager.download_file(driver.get_url())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/webdriver_manager/core/download_manager.py", line 28, in download_file
response = self._http_client.get(url)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/webdriver_manager/core/http.py", line 32, in get
self.validate_response(resp)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/webdriver_manager/core/http.py", line 15, in validate_response
raise ValueError(f"There is no such driver by url {resp.url}")
ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/106.0.5249.61/chromedriver_mac64_m1.zip

我尝试在 GitHub 上做一些研究,但无法找出错误 https://github.com/SergeyPirogov/webdriver_manager/issues/443

最佳答案

因为google已经将苹果硅macs的chromedriver的链接改了,看来新的链接是https://chromedriver.storage.googleapis.com/106.0.5249.61/chromedriver_mac_arm64.zip ,并且 webdriver-manager 的维护者尚未修补它。当他们这样做时,您可以尝试更新您的 webdriver_manager。

pip install webdriver-manager --upgrade

但现在,您应该直接访问上面的链接并直接下载 chromedriver。解压后,您可以使用 selenium 导入它,其余代码将保持不变。

代码将类似于,

from selenium import webdriver

browser = webdriver.Chrome(executable_path=r"/path/to/chromedriver")

更新:

本指南不适用于 selenium 4.10.0,请遵循 TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path' in Selenium Python如果您想使用4.10.0。

或者您可以安装 4.6.0 并按照此操作。

关于python - 值错误 : There is no such driver by url (chromedriver_mac64_m1. zip),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74048394/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com