import org.openqa.selenium.*;
import org.openqa.selenium.edge.EdgeDriver;
public class lianxi
{
private static EdgeDriver edgeDriver;
public static void main(String[] args)
{
openEdge();
}
public static void openEdge()
{
// 打开Edge浏览器
edgeDriver = new EdgeDriver();
// 访问百度
edgeDriver.get("http://www.baidu.com");
}
}
在运行之后
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting Microsoft Edge WebDriver 108.0.1462.46 (d29728ee681767b8b70995c207c659e2b46c2e92) on port 34050
To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver
Only local connections are allowed.
Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.
Microsoft Edge WebDriver was started successfully.
十二月 10, 2022 8:53:31 下午 org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
警告: Unable to find an exact match for CDP version 108, so returning the closest version found: 107