Skip to content

Commit

Permalink
hotfix: hola crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
in-seo committed Jul 10, 2024
1 parent 5539d25 commit 0d2c89b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 0d2c89b

Please sign in to comment.