新增手动签到
新增百合会签到 优化天使动漫签到 优化大头菜统计最高价日 修复大头菜第二周数据未清空 新增大头菜显示购入价功能
This commit is contained in:
@@ -31,6 +31,9 @@ public class AppTools {
|
||||
public static String getToDayTime() {
|
||||
return new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
}
|
||||
public static String getHours(){
|
||||
return new SimpleDateFormat("HH").format(new Date());
|
||||
}
|
||||
/**
|
||||
* 异常输出
|
||||
*
|
||||
|
||||
@@ -21,9 +21,11 @@ public class WebClient {
|
||||
}
|
||||
return client;
|
||||
}
|
||||
public WebDriver getWebDriver(){
|
||||
|
||||
public WebDriver getWebDriver() {
|
||||
return new ChromeDriver(getOptions());
|
||||
}
|
||||
|
||||
private WebClient() {
|
||||
System.setProperty("webdriver.chrome.driver",
|
||||
ConfigTools.load(ConfigTools.CONFIG, "chrome", String.class));
|
||||
@@ -31,27 +33,22 @@ public class WebClient {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static List<Cookie> loadCookie(JSONArray array){
|
||||
List<Cookie> list=new ArrayList<>();
|
||||
public static List<Cookie> loadCookie(JSONArray array) {
|
||||
List<Cookie> list = new ArrayList<>();
|
||||
|
||||
for (Object o : array) {
|
||||
JSONObject json = (JSONObject) o;
|
||||
boolean containsDate=json.containsKey("expirationDate");
|
||||
long t=0;
|
||||
if(containsDate) {
|
||||
t = Long.parseLong(json.getString("expirationDate").replace(".", "")) / 1000;
|
||||
boolean containsDate = json.containsKey("expirationDate");
|
||||
long t = 0;
|
||||
if (containsDate) {
|
||||
t = Long.parseLong(json.getString("expirationDate").replace(".", "")) / 1000;
|
||||
}
|
||||
|
||||
Cookie cookie = new Cookie(json.getString("name"),
|
||||
json.getString("value"),
|
||||
json.getString("domain"),
|
||||
json.getString("path"),
|
||||
containsDate? new Date(t):null,
|
||||
containsDate ? new Date(t) : new Date(),
|
||||
json.getBoolean("secure"),
|
||||
json.getBoolean("httpOnly")
|
||||
|
||||
@@ -63,9 +60,9 @@ public class WebClient {
|
||||
|
||||
public static ChromeOptions getOptions() {
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.addArguments("disable-infobars");
|
||||
options.addArguments("blink-settings=imagesEnabled=false");
|
||||
options.addArguments("--headless");
|
||||
options.addArguments("--disable-gpu");
|
||||
// options.addArguments("blink-settings=imagesEnabled=false");
|
||||
options.addArguments("--headless");
|
||||
options.addArguments("--no-sandbox");
|
||||
|
||||
return options;
|
||||
|
||||
Reference in New Issue
Block a user