Update Washington Post

This commit is contained in:
Kovid Goyal 2020-05-06 07:46:43 +05:30
parent 876623ab2e
commit 450b64a6f8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -29,11 +29,13 @@ class TheWashingtonPost(BasicNewsRecipe):
publication_type = 'newspaper'
keep_only_tags = [
dict(itemprop=['headline', 'articleBody']),
dict(name=['h1', 'figure']),
classes('byline article-body'),
]
remove_tags = [
dict(name=['meta', 'link']),
classes('inline-video'),
classes('inline-video author-tooltip author-image'),
dict(attrs={'data-qa': 'article-body-ad'}),
]
feeds = [
@ -51,6 +53,6 @@ class TheWashingtonPost(BasicNewsRecipe):
]
def preprocess_html(self, soup, *a):
for img in soup.findAll('img', attrs={'data-low-res-src': True}):
img['src'] = img['data-low-res-src']
for img in soup.findAll('img', srcset=True):
img['src'] = img['srcset'].split()[0]
return soup