Skip to content

Commit

Permalink
hotfix: hola service
Browse files Browse the repository at this point in the history
  • Loading branch information
in-seo committed Oct 23, 2022
1 parent 602c376 commit 9d809a1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public void getHolaPostData(){
Elements element = doc.select("#root > main > div.mainContent_appWrapper___CgAh > ul");
log.info("훌라 크롤링 시작, 가장 최신글번호 = {}",standard);
int count = element.select(">a").size();
for (int i = count; i >0; i--) {
for (int i = count; i >1; i--) {
if(i==count){
scroll((JavascriptExecutor) driver);
driver.findElement(By.cssSelector("#root > main > div.mainContent_appWrapper___CgAh > ul > a:nth-child(1)")).click();
driver.findElement(By.cssSelector("#root > main > div.mainContent_appWrapper___CgAh > ul > a:nth-child(2)")).click();
String first = driver.getCurrentUrl().substring(27);
if(first.compareTo(standard)<=0) {
log.warn("사이트 내 가장 최신글 번호 = {}, 따라서 불러올 글이 없습니다!",first);
Expand Down Expand Up @@ -86,8 +86,8 @@ public void getHolaPostData(){
log.warn("불러올 글이 없습니다!");
else
log.info("홀라 크롤링 성공");
}catch (Exception e) {
e.printStackTrace();
}catch (StringIndexOutOfBoundsException | InterruptedException e) {
log.error("잘못된 파싱. substring 실패");
} finally {
driver.close(); // 브라우저 종료
}
Expand Down

0 comments on commit 9d809a1

Please sign in to comment.