diff --git a/src/main/java/com/pcdd/sonovel/parse/CatalogParser.java b/src/main/java/com/pcdd/sonovel/parse/CatalogParser.java index 09d9112..e8396c9 100644 --- a/src/main/java/com/pcdd/sonovel/parse/CatalogParser.java +++ b/src/main/java/com/pcdd/sonovel/parse/CatalogParser.java @@ -57,8 +57,4 @@ public List parse(String url, int start, int end) { return catalog; } - public static void main(String[] args) { - new CatalogParser(1).parse("https://www.xbiqugu.info/66/66747/", 1, 50); - } - } \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3f6fbe2..28e0b53 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -3,4 +3,4 @@ version=@version@ # 书源 1 source_id=1 # 某书源 url -index_url=https://www.xbiqugu.info \ No newline at end of file +index_url=http://www.xbiqugu.net \ No newline at end of file diff --git a/src/main/resources/rule/rule1.json b/src/main/resources/rule/rule1.json index eedbbf5..d9a3997 100644 --- a/src/main/resources/rule/rule1.json +++ b/src/main/resources/rule/rule1.json @@ -1,9 +1,9 @@ { "id": "1", - "url": "https://www.xbiqugu.info", + "url": "http://www.xbiqugu.net", "comment": "", "book": { - "url": "https://www.xbiqugu.info/0/%s/", + "url": "http://www.xbiqugu.net/0/%s/", "bookName": "//*[@id=\"info\"]/h1", "author": "/html/head/meta[13]", "description": "//*[@id=\"intro\"]/p[2]", @@ -15,13 +15,13 @@ "catalog": "//*[@id=\"list\"]/dl/dd/a" }, "chapter": { - "url": "https://www.xbiqugu.info/0/%s/%s.html", + "url": "http://www.xbiqugu.net/0/%s/%s.html", "chapterNo": 0, "title": "", "content": "//*[@id=\"content\"]" }, "search": { - "url": "https://www.xbiqugu.info/modules/article/waps.php", + "url": "http://www.xbiqugu.net/modules/article/waps.php", "method": "post", "param": { "searchkey": "" diff --git a/src/test/java/com/pcdd/sonovel/CrawlTest.java b/src/test/java/com/pcdd/sonovel/CrawlTest.java index 822d085..4b2cee8 100644 --- a/src/test/java/com/pcdd/sonovel/CrawlTest.java +++ b/src/test/java/com/pcdd/sonovel/CrawlTest.java @@ -28,7 +28,7 @@ class CrawlTest { @DisplayName("解析搜索结果页") @SneakyThrows void test01() { - Connection connect = Jsoup.connect("https://www.xbiqugu.info/modules/article/waps.php"); + Connection connect = Jsoup.connect("http://www.xbiqugu.net/modules/article/waps.php"); // 搜索结果页DOM Document document = connect.data("searchkey", "斗罗大陆").post(); Elements elements = document.selectXpath("//*[@id=\"checkform\"]/table/tbody/tr"); @@ -49,7 +49,7 @@ void test01() { @DisplayName("爬取章节并下载") @SneakyThrows void test02() { - Document document = Jsoup.parse(new URL("https://www.xbiqugu.info/116/116314/43917573.html"), 30_000); + Document document = Jsoup.parse(new URL("http://www.xbiqugu.net/116/116314/43917573.html"), 30_000); String title = document.selectXpath("//*[@class='bookname']/h1").text(); System.out.println(title); String content = document.getElementById("content").html(); @@ -64,7 +64,7 @@ void test02() { } } - // @Test + @Test @DisplayName("目录排序") void test03() { File dir = FileUtil.file("D:\\Code\\IdeaProjects\\so-novel\\download\\斗罗大陆(唐家三少)");