Merge pull request #13 from 2niuhe/main

add isbn identifier
This commit is contained in:
Gary Fu 2023-01-03 10:37:27 +08:00 committed by GitHub
commit aed8caa810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,8 @@ class DoubanBookHtmlParser:
book.publishedDate = self.get_publish_date(self.get_tail(element))
elif text.startswith("丛书"):
book.series = self.get_text(element.getnext())
elif text.startswith("ISBN"):
book.identifiers["isbn"] = self.get_tail(element)
summary_element = html.xpath("//div[@id='link-report']//div[@class='intro']")
if len(summary_element):
book.description = etree.tostring(summary_element[-1], encoding="utf8").decode("utf8").strip()