报错提示:
2023-03-08T21:06:50.3292859Z Mar 08, 2023 4:06:50 PM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Invalid Status code=403 text=Forbidden
2023-03-08T21:06:50.3320374Z java.io.IOException: Invalid Status code=403 text=Forbidden
2023-03-08T21:06:50.3321045Z at org.asynchttpclient.netty.handler.WebSocketHandler.abort(WebSocketHandler.java:92)
2023-03-08T21:06:50.3321498Z at org.asynchttpclient.netty.handler.WebSocketHandler.handleRead(WebSocketHandler.java:118)
解决办法:
ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
WebDriver driver = new ChromeDriver(options);
或者降低driver和浏览器版本