From 1dd4e9f41f55699ac062ee052d06fc29d08ba536 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Wed, 5 Apr 2023 22:32:46 +0800 Subject: [PATCH] fix --- common/BaseComicEntity.py | 3 ++- domain/RouMan.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/BaseComicEntity.py b/common/BaseComicEntity.py index 1d0ba0c..d7a9ab6 100644 --- a/common/BaseComicEntity.py +++ b/common/BaseComicEntity.py @@ -23,7 +23,8 @@ class baseComic: comics = ListComic.getListComicsLinksUpdateAt() if comics == None: return False (book_name,comic_href,updated) = [comics[0],comics[1],comics[2]] - return cls.updateOneComic(book_name,comic_href,updated,chapters_xpath) + cls.updateOneComic(book_name,comic_href,updated,chapters_xpath) + return True @classmethod def updateOneComic(cls,book_name,comic_href,update_at,chapters_xpath): diff --git a/domain/RouMan.py b/domain/RouMan.py index 9039f51..7e679a4 100644 --- a/domain/RouMan.py +++ b/domain/RouMan.py @@ -13,7 +13,10 @@ class comicEntity: ListComic.setListComicName(books,"name") ListComic.setListComicChapterLink(books,"id",start_add=pathStr.getBaseUrl(url)+"/books/") ListComic.setListComicUpdateAt(books,"updatedAt") - return baseComic.updateComics(chapters_xpath='//div[contains(@class,"bookid_chapterBox")]//div[contains(@class,"bookid_chapter")]/a/text()') + is_next = True + while is_next: + is_next = baseComic.updateComics(chapters_xpath='//div[contains(@class,"bookid_chapterBox")]//div[contains(@class,"bookid_chapter")]/a/text()') + cls.oneComic() @classmethod def oneComic(cls,sleep=None): @@ -37,4 +40,4 @@ class comicEntity: @classmethod def start(cls,url): - while cls.downladsComcis(url): cls.oneComic() \ No newline at end of file + cls.downladsComcis(url) \ No newline at end of file