calibre-web的豆瓣api provider

This commit is contained in:
Gary Fu 2021-10-28 19:25:34 +08:00
parent 8ad96fec3f
commit fc4335717e
1 changed files with 2 additions and 2 deletions

View File

@ -147,10 +147,10 @@ class DoubanBookHtmlParser:
text = element[0].text.strip()
elif isinstance(element, etree._Element) and element.text:
text = element.text.strip()
return text
return text if text else default_str
def get_tail(self, element, default_str=''):
text = default_str
if isinstance(element, etree._Element) and element.tail:
text = element.tail.strip()
return text
return text if text else default_str