适用于 chrome 119 的 Webdriver 管理器

问题描述 投票:0回答:1

我在 Webdriver 管理器中遇到以下错误:

  File "C:\Users\Chetan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\webdriver_manager\core\http.py", line 37, in get
    self.validate_response(resp)
  File "C:\Users\Chetan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\webdriver_manager\core\http.py", line 16, 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/LATEST_RELEASE_119.0.6045

我的代码如下:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://pypi.org/project/webdriver-manager/')

如何解决?

selenium-webdriver selenium-chromedriver webdriver webdriver-manager
1个回答
0
投票

找到解决方案;它使用 Botasaurus 自动下载并启动 Chrome。

安装

pip install botasaurus

示例

from botasaurus import *

driver = bt.create_driver()

driver.get("http://www.python.org")
driver.prompt()
driver.quit()
© www.soinside.com 2019 - 2024. All rights reserved.