From 348e88abd8fc404e8ab156d984c0df1065cf5ece Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 Aug 2011 07:00:57 -0600 Subject: [PATCH] ... --- src/calibre/web/feeds/news.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index 1945425392..436612af7e 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -556,7 +556,11 @@ class BasicNewsRecipe(Recipe): article_html = doc.summary() extracted_title = doc.title() - frag = fragment_fromstring(article_html) + try: + frag = fragment_fromstring(article_html) + except: + doc = document_fromstring(article_html) + frag = doc.xpath('//body')[-1] if frag.tag == 'html': root = frag elif frag.tag == 'body':