Fix EPUB output of Speigel Online

This commit is contained in:
Kovid Goyal 2009-03-23 13:44:58 -07:00
parent 923671d402
commit 5c5cc6d1a2

View File

@ -8,7 +8,7 @@ Fetch Spiegel Online.
import re
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class SpeigelOnline(BasicNewsRecipe):
@ -36,3 +36,13 @@ class SpeigelOnline(BasicNewsRecipe):
tokens = url.split(',')
tokens[-2:-2] = ['druck|']
return ','.join(tokens).replace('|,','-')
def postprocess_html(self, soup, first_fetch):
if soup.contents[0].name == 'head':
x = BeautifulSoup('<html></html>')
for y in reversed(soup.contents):
x.contents[0].insert(0, y)
soup = x
print 1111111
return soup