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

无法找到CDP版本116精确匹配,返回版本115问题咨询

错误解决:SLF4J日志加载失败与Selenium CDP版本不匹配

一、SLF4J日志组件错误

错误内容

SLF4J: 无法加载类 "org.slf4j.impl.StaticLoggerBinder"。
SLF4J: 默认使用无操作(NOP)日志实现
SLF4J: 查看官方文档获取更多详情。

解决办法

  • Maven项目添加SLF4J绑定依赖(以logback为例):
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.4.8</version>
</dependency>
  • Gradle项目添加:
implementation 'ch.qos.logback:logback-classic:1.4.8'
  • 也可根据项目需求选择其他SLF4J绑定,比如log4j-slf4j-impl。

二、Selenium CDP版本不匹配警告

错误内容

2023年9月1日 下午1:10:54 org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
警告:无法找到CDP版本116的精确匹配,因此返回找到的最接近版本:115

解决办法

  • 升级Selenium版本:使用支持CDP 116的Selenium版本(如4.11.0及以上),Maven依赖示例:
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.11.0</version>
</dependency>
  • 降级Chrome浏览器:把Chrome降到115版本,与当前Selenium支持的CDP版本对齐。
  • 手动指定CDP版本:初始化ChromeDriver时显式指定CDP版本,代码示例:
ChromeOptions options = new ChromeOptions();
options.setCapability("goog:chromeOptions", ImmutableMap.of("cdpVersion", "116"));
WebDriver driver = new ChromeDriver(options);

内容的提问来源于stack exchange,提问作者Bhumika Sonawane

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.11 17:52:46