diff --git a/SouP/src/main/java/Matching/SouP/crawler/okky/OkkyService.java b/SouP/src/main/java/Matching/SouP/crawler/okky/OkkyService.java index 07b5c16..5f234ff 100644 --- a/SouP/src/main/java/Matching/SouP/crawler/okky/OkkyService.java +++ b/SouP/src/main/java/Matching/SouP/crawler/okky/OkkyService.java @@ -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; @@ -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('?'));