Update Foreign Affairs

This commit is contained in:
Kovid Goyal 2019-08-19 08:27:33 +05:30
parent 099cbca59c
commit b657ba60d7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -164,8 +164,7 @@ class ForeignAffairsRecipe(BasicNewsRecipe):
FRONTPAGE = INDEX + '/magazine'
keep_only_tags = [
dict(attrs={'class': lambda x: x and set(x.split()).intersection(
set('article-header l-article-column'.split()))}),
classes('article-header article-body'),
]
conversion_options = {'comments': description, 'tags': category, 'language': 'en',
@ -199,8 +198,9 @@ class ForeignAffairsRecipe(BasicNewsRecipe):
return html.tostring(root, encoding='unicode')
def preprocess_html(self, soup):
for img in soup.findAll('img', attrs={'ng-src': True}):
img['src'] = img['ng-src']
for attr in ('ng-src', 'data-blazy'):
for img in soup.findAll('img', attrs={attr: True}):
img['src'] = img[attr]
return soup
def get_browser(self):