update 更新selenium版本

This commit is contained in:
Yutousama 2023-03-18 13:41:47 +08:00
parent 83e3b5adae
commit 9fc377f070
2 changed files with 8 additions and 1 deletions

View File

@ -98,7 +98,12 @@
<dependency> <dependency>
<groupId>org.seleniumhq.selenium</groupId> <groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId> <artifactId>selenium-remote-driver</artifactId>
<version>4.7.1</version> <version>4.8.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-http-jdk-client</artifactId>
<version>4.8.1</version>
</dependency> </dependency>

View File

@ -37,6 +37,7 @@ public class WebClient {
} }
private WebClient() { private WebClient() {
//System.setProperty("webdriver.http.factory", "jdk-http-client");
System.setProperty("webdriver.chrome.driver", System.setProperty("webdriver.chrome.driver",
ConfigTools.load(ConfigTools.CONFIG, "chrome", String.class)); ConfigTools.load(ConfigTools.CONFIG, "chrome", String.class));
// System.setProperty("webdriver.chrome.whitelistedIps", ""); // System.setProperty("webdriver.chrome.whitelistedIps", "");
@ -84,6 +85,7 @@ public class WebClient {
public ChromeOptions getOptions() { public ChromeOptions getOptions() {
ChromeOptions options = new ChromeOptions(); ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
// options.addArguments("--disable-gpu"); // options.addArguments("--disable-gpu");
// options.addArguments("blink-settings=imagesEnabled=false"); // options.addArguments("blink-settings=imagesEnabled=false");
String headless = RedisTools.get("chromedrive_headless"); String headless = RedisTools.get("chromedrive_headless");