This commit is contained in:
Kovid Goyal 2011-08-25 07:00:57 -06:00
parent 4f21f06f76
commit 348e88abd8

View File

@ -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':