mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix #1867 (Time magazine download failure)
This commit is contained in:
parent
da33e04397
commit
a8d514092f
@ -493,7 +493,17 @@ class Parser(PreProcessor, LoggingInterface):
|
||||
self.root.insert(0, head)
|
||||
|
||||
self.head = head
|
||||
self.body = self.root.body
|
||||
try:
|
||||
self.body = self.root.body
|
||||
except:
|
||||
import traceback
|
||||
err = traceback.format_exc()
|
||||
self.root = fromstring(u'<html><head/><body><p>This page was too '
|
||||
'severely malformed for calibre to handle. '
|
||||
'It has been replaced by this error message.'
|
||||
'</p><pre>%s</pre></body></html>'%err)
|
||||
self.head = self.root.xpath('./head')[0]
|
||||
self.body = self.root.body
|
||||
for a in self.root.xpath('//a[@name]'):
|
||||
a.set('id', a.get('name'))
|
||||
if not self.head.xpath('./title'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user