Procházet zdrojové kódy

修改运营商报表爬虫获取逻辑

syh před 4 roky
rodič
revize
1c6414a149

+ 6 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAgentServiceImpl.java

@@ -88,9 +88,9 @@ public class KuaishouReportDailyAgentServiceImpl extends ServiceImpl<KuaishouRep
         ChromeOptions chromeOptions = new ChromeOptions();
 //        chromeOptions.addArguments("--headless");
 //        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("--user-agent=" + HttpUtils2.USER_AGENT);
         chromeOptions.setAcceptInsecureCerts(true);
@@ -102,12 +102,12 @@ public class KuaishouReportDailyAgentServiceImpl extends ServiceImpl<KuaishouRep
             //获取登录页面
             webDriver.get(url);
             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");
             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");
-            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);
             //点击登录
             loginElement.click();