mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
2ded6daf02
commit
e4ea6f9e15
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user