因此,我开始运行基本的打开 chrome on web、selenium 程序。
导入 org.openqa.selenium.chrome.*;
公共类测试{
static {
System.setProperty("webdriver.chrome.driver","./driver/chromedriver.exe");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ChromeDriver driver= new ChromeDriver();
driver.close();
}
Run Code Online (Sandbox Code Playgroud)
}
出现以下错误:
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 ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 50054
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Jun 08, 2022 11:17:57 AM …Run Code Online (Sandbox Code Playgroud)