From f6f12d1cfbdbb4382b065021d3ad66038fc9d4d0 Mon Sep 17 00:00:00 2001 From: chatinEu Date: Sat, 12 Nov 2022 15:29:46 +0100 Subject: [PATCH] fix kakuyomu novel title fetch --- src/Downloaders.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Downloaders.py b/src/Downloaders.py index bf21c3d..b2c8f5d 100644 --- a/src/Downloaders.py +++ b/src/Downloaders.py @@ -365,8 +365,12 @@ def setUrl(self): self.url = 'https://kakuyomu.jp/works/%s' % self.code def parseTitle(self, TocHTML): - chapter_title = re.findall( - '

(.*?)<', TocHTML)[0] + soup = BeautifulSoup(TocHTML,'html.parser') + chapter_title =soup.find('h1',id='workTitle').text + # print(soup.find('h1',class_='workTitle')) + + # chapter_title = re.findall( + # '

(.*?)<', TocHTML)[0] return chapter_title def parseOnlineChapterList(self, html) -> list: