This commit is contained in:
Kovid Goyal 2019-09-12 18:54:39 +05:30
parent 2ded6daf02
commit e4ea6f9e15
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,6 +1,6 @@
import re import re
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Tag from calibre.ebooks.BeautifulSoup import Tag, NavigableString
from datetime import date, timedelta from datetime import date, timedelta
@ -235,6 +235,9 @@ class BostonGlobeSubscription(BasicNewsRecipe):
def preprocess_html(self, soup): def preprocess_html(self, soup):
body = soup.find('body') body = soup.find('body')
title = soup.find('title') title = soup.find('title')
t = type('')(title.contents[0]).partition('-')[0].strip()
del title.contents[0]
title.contents.append(NavigableString(t))
title.name = 'h1' title.name = 'h1'
body.insert(0, title) body.insert(0, title)
images = soup.findAll("img") images = soup.findAll("img")