From 3278cb33df34bd6a1be6818aea1f078aa4a0ac1c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 26 Jun 2019 00:44:42 +0200 Subject: Check for error when parsing rss --- plugins/manganelo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/manganelo.py') diff --git a/plugins/manganelo.py b/plugins/manganelo.py index 25114fa..a37dfa7 100755 --- a/plugins/manganelo.py +++ b/plugins/manganelo.py @@ -51,9 +51,10 @@ def list_chapters(url, latest): tree = etree.HTML(response.text) chapters = [] for element in tree.xpath('//div[@class="chapter-list"]//a'): - if latest and element.text == latest: + element_text = element.text.strip() + if latest and element_text == latest: break - chapters.append({ "name": element.text.strip(), "url": element.attrib.get("href").strip() }) + chapters.append({ "name": element_text, "url": element.attrib.get("href").strip() }) print(json.dumps({ "items": chapters })) def download_chapter(url, download_dir): -- cgit v1.2.3