Commit a8f315b4b61de800c89b1ff020d9c8ee41c5cd82
1 parent
03520b5e
2022年11月1日18:37:29 优化
Showing
1 changed file
with
2 additions
and
2 deletions
src/main/java/cn/fw/freya/service/crawl/impl/KuaiShouCrawl.java
@@ -846,12 +846,12 @@ public class KuaiShouCrawl implements CrawlStrategy, SmartLifecycle { | @@ -846,12 +846,12 @@ public class KuaiShouCrawl implements CrawlStrategy, SmartLifecycle { | ||
846 | this.exitBrowser(accountNo, uuid); | 846 | this.exitBrowser(accountNo, uuid); |
847 | return null; | 847 | return null; |
848 | } | 848 | } |
849 | - Integer maxPageNum = 0; | 849 | + int maxPageNum = 0; |
850 | if (videoDimension) { | 850 | if (videoDimension) { |
851 | List<WebElement> pageLabels = new WebDriverWait(driver, 15, 300).until(driver1 -> | 851 | List<WebElement> pageLabels = new WebDriverWait(driver, 15, 300).until(driver1 -> |
852 | driver1.findElements(By.xpath("//ul[@class='el-pager']/li")));// 获取分页页码标签元素列表 | 852 | driver1.findElements(By.xpath("//ul[@class='el-pager']/li")));// 获取分页页码标签元素列表 |
853 | - maxPageNum = Integer.valueOf(pageLabels.get(pageLabels.size() - 1).getText());// 最大页码 | ||
854 | if (!CollectionUtils.isEmpty(pageLabels)) { | 853 | if (!CollectionUtils.isEmpty(pageLabels)) { |
854 | + maxPageNum = Integer.parseInt(pageLabels.get(pageLabels.size() - 1).getText());// 最大页码 | ||
855 | for (WebElement item : pageLabels) { | 855 | for (WebElement item : pageLabels) { |
856 | try { | 856 | try { |
857 | /*if (Objects.equals(item.getText(), "...")) { | 857 | /*if (Objects.equals(item.getText(), "...")) { |