|
@@ -88,9 +88,9 @@ public class KuaishouReportDailyAgentServiceImpl extends ServiceImpl<KuaishouRep
|
|
ChromeOptions chromeOptions = new ChromeOptions();
|
|
ChromeOptions chromeOptions = new ChromeOptions();
|
|
// chromeOptions.addArguments("--headless");
|
|
// chromeOptions.addArguments("--headless");
|
|
// chromeOptions.addArguments("--no-sandbox");
|
|
// chromeOptions.addArguments("--no-sandbox");
|
|
-// chromeOptions.addArguments("--disable-dev-shm-usage");
|
|
|
|
-// chromeOptions.addArguments("--incognito");
|
|
|
|
-// chromeOptions.addArguments("--disable-gpu");
|
|
|
|
|
|
+ chromeOptions.addArguments("--disable-dev-shm-usage");
|
|
|
|
+ chromeOptions.addArguments("--incognito");
|
|
|
|
+ chromeOptions.addArguments("--disable-gpu");
|
|
chromeOptions.addArguments("--window-size=1920,1080");
|
|
chromeOptions.addArguments("--window-size=1920,1080");
|
|
chromeOptions.addArguments("--user-agent=" + HttpUtils2.USER_AGENT);
|
|
chromeOptions.addArguments("--user-agent=" + HttpUtils2.USER_AGENT);
|
|
chromeOptions.setAcceptInsecureCerts(true);
|
|
chromeOptions.setAcceptInsecureCerts(true);
|
|
@@ -102,12 +102,12 @@ public class KuaishouReportDailyAgentServiceImpl extends ServiceImpl<KuaishouRep
|
|
//获取登录页面
|
|
//获取登录页面
|
|
webDriver.get(url);
|
|
webDriver.get(url);
|
|
Thread.sleep(3000L);
|
|
Thread.sleep(3000L);
|
|
- WebElement accountElement = webDriver.findElement(By.xpath("//div[@class='phone ']/input[@type='text']"));
|
|
|
|
|
|
+ WebElement accountElement = webDriver.findElement(By.xpath("//div[contains(@class,'component-input-container')]/input[@type='text']"));
|
|
accountElement.sendKeys("17718376864");
|
|
accountElement.sendKeys("17718376864");
|
|
Thread.sleep(3000L);
|
|
Thread.sleep(3000L);
|
|
- WebElement passwordElement = webDriver.findElement(By.xpath("//div[@class='password ']/input[@type='password']"));
|
|
|
|
|
|
+ WebElement passwordElement = webDriver.findElement(By.xpath("//div[contains(@class,'component-input-container')]/input[@type='password']"));
|
|
passwordElement.sendKeys("yehcbost85567");
|
|
passwordElement.sendKeys("yehcbost85567");
|
|
- WebElement loginElement = webDriver.findElement(By.xpath("//div[@class='foot']"));
|
|
|
|
|
|
+ WebElement loginElement = webDriver.findElement(By.xpath("//div[@class='btn-container']/button[contains(@class,'submit')]"));
|
|
Thread.sleep(3000L);
|
|
Thread.sleep(3000L);
|
|
//点击登录
|
|
//点击登录
|
|
loginElement.click();
|
|
loginElement.click();
|