From 0d2c89b2d79bc1e29fbe9cd9783ba3ca4ec73bba Mon Sep 17 00:00:00 2001 From: in-seo Date: Wed, 10 Jul 2024 10:31:35 +0900 Subject: [PATCH] hotfix: hola crawler --- .../src/main/java/Matching/SouP/crawler/Hola/HolaService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SouP/src/main/java/Matching/SouP/crawler/Hola/HolaService.java b/SouP/src/main/java/Matching/SouP/crawler/Hola/HolaService.java index e501f00..0862dd0 100644 --- a/SouP/src/main/java/Matching/SouP/crawler/Hola/HolaService.java +++ b/SouP/src/main/java/Matching/SouP/crawler/Hola/HolaService.java @@ -39,7 +39,7 @@ public void getHolaPostData(){ log.warn("글 갯수 = {} ",count); for (int i = count; i > 0; i--) { if(i==count){ - driver.findElement(By.cssSelector("#root > main > ul > a:nth-child(2)")).click(); + driver.findElement(By.cssSelector("#root > main > ul > a:nth-child(1)")).click(); String first = driver.getCurrentUrl().substring(beginIndex); if(first.compareTo(standard) <= 0) { log.warn("사이트 내 가장 최신글 번호 = {}, 따라서 불러올 글이 없습니다!",first); @@ -48,7 +48,7 @@ public void getHolaPostData(){ else driver.navigate().back(); } - int aSelector = i*2; // 짝수번만 사용 예정 + int aSelector = i*2 - 1; // 홀수번만 사용 예정 Elements eachPost = element.select("a:nth-child(" + aSelector + ")"); driver.get(urlHola + eachPost.attr("href")); Thread.sleep(500);