This commit is contained in:
caiwx86 2023-04-05 22:32:46 +08:00
parent de988e4132
commit 1dd4e9f41f
2 changed files with 7 additions and 3 deletions

View File

@ -23,7 +23,8 @@ class baseComic:
comics = ListComic.getListComicsLinksUpdateAt() comics = ListComic.getListComicsLinksUpdateAt()
if comics == None: return False if comics == None: return False
(book_name,comic_href,updated) = [comics[0],comics[1],comics[2]] (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 @classmethod
def updateOneComic(cls,book_name,comic_href,update_at,chapters_xpath): def updateOneComic(cls,book_name,comic_href,update_at,chapters_xpath):

View File

@ -13,7 +13,10 @@ class comicEntity:
ListComic.setListComicName(books,"name") ListComic.setListComicName(books,"name")
ListComic.setListComicChapterLink(books,"id",start_add=pathStr.getBaseUrl(url)+"/books/") ListComic.setListComicChapterLink(books,"id",start_add=pathStr.getBaseUrl(url)+"/books/")
ListComic.setListComicUpdateAt(books,"updatedAt") 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 @classmethod
def oneComic(cls,sleep=None): def oneComic(cls,sleep=None):
@ -37,4 +40,4 @@ class comicEntity:
@classmethod @classmethod
def start(cls,url): def start(cls,url):
while cls.downladsComcis(url): cls.oneComic() cls.downladsComcis(url)