fix
This commit is contained in:
parent
89c7443bcb
commit
ba57978ab2
@ -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")
|
||||||
|
|||||||
@ -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 = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user