You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Eclipse控制台出现警告求助:ChromeDriver与CDP版本不匹配

解决Selenium中CDP版本106不匹配的警告问题

问题日志

Starting ChromeDriver 106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249@{#569}) on port 49652
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Oct 07, 2022 1:44:50 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Oct 07, 2022 1:44:50 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 106, so returning the closest version found: a no-op implementation
Oct 07, 2022 1:44:50 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 106.
Oct 07, 2022 1:44:50 AM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.1.2` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.

问题原因

当前使用的Selenium版本未内置Chrome DevTools Protocol(CDP)106版本的实现,无法与ChromeDriver 106完成版本匹配,因此抛出警告。

解决步骤

根据你的项目类型,添加对应版本的CDP依赖:

  • Maven项目:在pom.xml中插入以下依赖,替换你的Selenium版本号为实际使用的Selenium版本(比如4.5.0)

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-devtools-v106</artifactId>
        <version>你的Selenium版本号</version>
    </dependency>
    
  • Gradle项目:在build.gradle中添加

    implementation 'org.seleniumhq.selenium:selenium-devtools-v106:你的Selenium版本号'
    
  • 普通Java项目:下载对应版本的selenium-devtools-v106.jar,添加到项目类路径中。

注意:devtools的版本标识(v106)必须和Chrome/ChromeDriver的主版本一致,依赖版本号必须和Selenium版本完全匹配。

内容的提问来源于stack exchange,提问作者Vrushabh Wagh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 15:00:53