Update San Jose Mercury News

Fixes #1629944 [San Jose Mercury recipe not working](https://bugs.launchpad.net/calibre/+bug/1629944)
This commit is contained in:
Kovid Goyal 2016-10-03 23:06:58 +05:30
parent 1d6c9005f2
commit 2ff339bfa3

View File

@ -28,19 +28,16 @@ class MercuryNews(BasicNewsRecipe):
} }
keep_only_tags = [ keep_only_tags = [
dict(name='h1', attrs={'id': 'articleTitle'}), dict( dict(name='h1'),
name='div', attrs={'id': 'articleBody'}) dict(attrs={'class':['byline', 'time', 'article-body']}),
] dict(attrs={'class':lambda x: x and 'header-features' in x.split()}),
remove_tags = [
dict(name='div', attrs={'class': 'articleEmbeddedAdBox'}), dict(name=[
'link', 'iframe', 'object']), dict(name='div', attrs={'id': 'articleViewerGroup'})
] ]
feeds = [ feeds = [
('News', 'http://www.mercurynews.com/feed/')
(u'News', u'http://feeds.mercurynews.com/mngi/rss/CustomRssServlet/568/200735.xml'),
(u'Politics', u'http://feeds.mercurynews.com/mngi/rss/CustomRssServlet/568/200740.xml'),
(u'Local News', u'http://feeds.mercurynews.com/mngi/rss/CustomRssServlet/568/200748.xml'),
(u'Editorials', u'http://feeds.mercurynews.com/mngi/rss/CustomRssServlet/568/200766.xml'),
(u'Opinion', u'http://feeds.mercurynews.com/mngi/rss/CustomRssServlet/568/200224.xml')
] ]
def preprocess_html(self, soup, *a):
for img in soup.findAll(name='img', attrs={'data-src':True}):
img['src'] = img['data-src']
return soup