- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
堆栈跟踪:
Starting ChromeDriver 96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}) on port 58050
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Nov 20, 2021 9:34:48 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Nov 20, 2021 9:34:49 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 96, so returning the closest version found: 95
Nov 20, 2021 9:34:49 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found CDP implementation for version 96 of 95
Nov 20, 2021 9:36:34 AM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Connection reset
java.net.SocketException: Connection reset
at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:831)
我正在制作一个 java selenium 机器人,当我启动机器人时,它说在代码的最后一行之后连接重置
我得到这个错误,即使我的
请帮忙
代码如下:
public static void main(String[] args) throws InterruptedException {
//region GUI
int loginTimeOutDuration = 100000;
int chatLoadingDelay = 1000;
String serverID = "707324806856572949";
String message = "Hi!";
//endregion
System.setProperty
("webdriver.chrome.driver","C:\\\\Users\\\\~~~~~\\\\Downloads\\\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
String baseUrl = "https://discord.com/channels/" + serverID + "/";
driver.get(baseUrl);
Thread.sleep(loginTimeOutDuration);
WebElement element = driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[2]/div/div/div/" +
"div/div[2]/div[2]/div/aside/div/div/div[2]/div/div[2]/div[1]"));
Actions actions = new Actions(driver);
actions.contextClick(element).perform();
driver.findElement(By.xpath("/html/body/div[1]/div[5]/div/div/div/div[1]/div[2]")).click();
driver.close();
}
最佳答案
这个错误信息...
Nov 20, 2021 9:34:49 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 96, so returning the closest version found: 95
Nov 20, 2021 9:34:49 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found CDP implementation for version 96 of 95
Nov 20, 2021 9:36:34 AM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Connection reset
java.net.SocketException: Connection reset
...暗示 ChromeDriver 无法启动/生成新的浏览上下文,即 Chrome 浏览器 session 和 java.net.SocketException:连接重置
发生。
您的主要问题是您使用的二进制文件版本之间的不兼容,如下所示:
- Supported CDP versions: 85, 93, 94, 95
因此,您会看到:
WARNING: Unable to find an exact match for CDP version 96, so returning the closest version found: 95
确保:
- Supported CDP versions: 85, 94, 95, 96
关于java - Selenium Connection Reset : Unable to find an exact match for CDP version 96, 所以返回找到的最接近的版本:95,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70043181/
总的来说,我对脚本编写还很陌生。我正在编写一个 expect 脚本,它通过 ssh 进入 Cisco 交换机,并运行“show cdp neighbors”命令来获取连接到交换机的所有设备的列表。然后
我是 Selenium 的新手,在运行我的代码时遇到有关 CDP 版本的错误。这是我的代码。很简单,旨在登录某个网页。驱动程序打开,填写电子邮件和密码,但当到达按钮时,驱动程序关闭。即使我在按钮后设置
我正在尝试让 Selenium 与 Java 一起工作。我正在使用 Maven。我的 pom.xml 文件看起来像这样 org.seleniumhq.selenium selenium-ja
我正在尝试让 Selenium 与 Java 一起工作。我正在使用 Maven。我的 pom.xml 文件看起来像这样 org.seleniumhq.selenium selenium-ja
堆栈跟踪: Starting ChromeDriver 96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads
我是一名优秀的程序员,十分优秀!