This commit is contained in:
caiwx86 2023-04-05 22:46:33 +08:00
parent 89c7443bcb
commit ba57978ab2
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ class comicEntity:
def downladsComcis(cls,url): def downladsComcis(cls,url):
str_xpath='//script[@id="__NEXT_DATA__"]/text()' str_xpath='//script[@id="__NEXT_DATA__"]/text()'
str_exec="props.pageProps.books" str_exec="props.pageProps.books"
books = htmlUtils.setXpathData(url,xpath=str_xpath,num=0,exec=str_exec) books = htmlUtils.setXpathData(url,xpath=str_xpath,num=0,exec=str_exec,update=True)
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")

View File

@ -33,8 +33,8 @@ class htmlUtils:
return htmlUtils.xpathData(c_xpath=c_xpath,url=url,num=num,not_eq=not_eq,update=update) return htmlUtils.xpathData(c_xpath=c_xpath,url=url,num=num,not_eq=not_eq,update=update)
@classmethod @classmethod
def setXpathData(cls,url,xpath,exec,num=None,result_type=None,type=None,start_add=None): def setXpathData(cls,url,xpath,exec,num=None,result_type=None,type=None,start_add=None,update=False):
result = cls.parseExec(htmlUtils.xpathData(xpath,url=url,num=num),exec) result = cls.parseExec(htmlUtils.xpathData(xpath,url=url,num=num,update=update),exec)
if result == None: return None if result == None: return None
if result_type == "list" and type != None: if result_type == "list" and type != None:
data = [] data = []