Skip to content

Commit

Permalink
Update OkkyService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
in-seo authored Aug 9, 2024
1 parent 04f1c48 commit 1a203bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void getOkkyPostData() {
String html = driver.getPageSource();
Document doc = Jsoup.parse(html);
for (int i = 20; i > 0; i--) { //오래된 글부터 크롤링 그럼 반드시 최신글은 DB에서 가장 밑에꺼임.
Elements element = doc.select("#__next > main > div > div:nth-child(2) > div > div:nth-child(5) > div > ul > li.py-3.5 sm:py-4:nth-child(" + i + ")");
Elements element = doc.select("#__next > main > div > div:nth-child(2) > div > div:nth-child(5) > div > ul > li.py-3.5.sm\:py-4:nth-child(" + i + ")");
Elements title = element.select("div > div.my-2 > a");
String postName = title.text();
String num;
Expand Down Expand Up @@ -107,7 +107,7 @@ private int startPage(WebDriver driver, int start) throws StringIndexOutOfBounds
Document doc = Jsoup.parse(html);
int num = Integer.MAX_VALUE;
try {
String href = doc.select("#__next > main > div > div:nth-child(2) > div > div:nth-child(5) > div > ul > li.py-3.5 sm:py-4:nth-child(" + cnt + ") > div > div.my-2 > a")
String href = doc.select("#__next > main > div > div:nth-child(2) > div > div:nth-child(5) > div > ul > li.py-3.5.sm\:py-4:nth-child(" + cnt + ") > div > div.my-2 > a")
.attr("href");
log.info(href);
String sNum = href.substring(10, href.lastIndexOf('?'));
Expand Down

0 comments on commit 1a203bb

Please sign in to comment.