我在 Windows 上安装了 Chrome 115.0.5790.99,并且使用 Selenium 4.10.0。在我的 Python 代码中,我调用service = Service(ChromeDriverManager().install())并返回错误:
ValueError: url [sic] https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790没有这样的驱动程序。
我使用 ChromeDriverManager().install() 来确保使用最新稳定版本的 webdriver。如何解决问题?
我的简单代码:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time
# Install Webdriver
service = Service(ChromeDriverManager().install())
# Create Driver Instance
driver = webdriver.Chrome(service=service)
# Get Web Page
driver.get('https://www.crawler-test.com')
time.sleep(5)
driver.quit()
Run Code Online (Sandbox Code Playgroud)
错误输出:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time
# Install Webdriver
service = Service(ChromeDriverManager().install())
# Create …Run Code Online (Sandbox Code Playgroud) 我正在 AWS Batch 环境中的 Docker 容器中运行 Docker 映像。一段时间以来一切都运行良好,但从今天开始我收到以下错误。
E selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This
version of ChromeDriver only supports Chrome version 114
E Current browser version is 116.0.5845.96 with binary path /opt/google/chrome/google-chrome
Run Code Online (Sandbox Code Playgroud)
chrome安装的Dockerfile如下
FROM python:3.10
WORKDIR /usr/src/app
COPY . .
RUN pip install --trusted-host pypi.org --upgrade pip
RUN pip install --no-cache-dir \
--extra-index-url https://artifactory.int.csgdev01.citcosvc.com/artifactory/api/pypi/citco-
pypi/simple \
-r requirements.txt
RUN pip install awscli
RUN apt-get install -yqq unzip curl
RUN apt-get -y update
RUN apt-get install zip -y
RUN apt-get …Run Code Online (Sandbox Code Playgroud) python google-chrome amazon-web-services selenium-webdriver docker
我收到以下错误:
selenium.common.exceptions.SessionNotCreatedException:消息:会话未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 114 当前浏览器版本为 116.0.5845.97,二进制路径为 C:\Program Files\Google\Chrome\Application\chrome.exe
谁能帮我?我在其他帖子中看到了一些建议,但在这里不起作用。我知道 Selenium v4.6 更新
我的代码:
from selenium import webdriver
import time
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
class ChromeAuto:
def __init__(self):
self.options = webdriver.ChromeOptions()
self.options.add_experimental_option('excludeSwitches', ['enable-logging'])
self.service = Service()
self.chrome = webdriver.Chrome(service=self.service, options=self.options)
self.chrome.implicitly_wait(20)
Run Code Online (Sandbox Code Playgroud)