From 0de499fb5711ab215d35bef3ec00b5a9b3092ac5 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Fri, 28 Oct 2022 09:41:48 +0800 Subject: [PATCH] fix BaiHeHui.java --- .../java/com/yutou/qqbot/models/WebSign/BaiHeHui.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/yutou/qqbot/models/WebSign/BaiHeHui.java b/src/main/java/com/yutou/qqbot/models/WebSign/BaiHeHui.java index e59ec6f..ebe4c9d 100644 --- a/src/main/java/com/yutou/qqbot/models/WebSign/BaiHeHui.java +++ b/src/main/java/com/yutou/qqbot/models/WebSign/BaiHeHui.java @@ -11,6 +11,7 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import java.io.File; +import java.time.Duration; import java.util.concurrent.TimeUnit; @UseModel public class BaiHeHui extends Model { @@ -50,14 +51,9 @@ public class BaiHeHui extends Model { } public boolean sign() { - String cookie = ConfigTools.readFile(new File("baihehui.json")); - if (StringUtils.isEmpty(cookie)||true) { - return false; - } WebDriver driver = WebClient.getInstance().getWebDriver(); try { - JSONArray array = JSON.parseArray(cookie); - driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS); + driver.manage().timeouts().implicitlyWait( Duration.ofSeconds(5)); driver.get("https://bbs.yamibo.com/forum.php"); login(driver); // driver.manage().deleteAllCookies();