fix BaiHeHui.java

This commit is contained in:
Yutousama 2022-10-28 09:41:48 +08:00
parent 7623858866
commit 0de499fb57

View File

@ -11,6 +11,7 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import java.io.File; import java.io.File;
import java.time.Duration;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@UseModel @UseModel
public class BaiHeHui extends Model { public class BaiHeHui extends Model {
@ -50,14 +51,9 @@ public class BaiHeHui extends Model {
} }
public boolean sign() { public boolean sign() {
String cookie = ConfigTools.readFile(new File("baihehui.json"));
if (StringUtils.isEmpty(cookie)||true) {
return false;
}
WebDriver driver = WebClient.getInstance().getWebDriver(); WebDriver driver = WebClient.getInstance().getWebDriver();
try { try {
JSONArray array = JSON.parseArray(cookie); driver.manage().timeouts().implicitlyWait( Duration.ofSeconds(5));
driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS);
driver.get("https://bbs.yamibo.com/forum.php"); driver.get("https://bbs.yamibo.com/forum.php");
login(driver); login(driver);
// driver.manage().deleteAllCookies(); // driver.manage().deleteAllCookies();