From d452eea2b6c54119652313a649d511d77b8565f1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 Oct 2021 18:55:48 +0530 Subject: [PATCH] Update Foreign Policy --- recipes/foreign_policy.recipe | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/foreign_policy.recipe b/recipes/foreign_policy.recipe index eff88f06d8..42806fe841 100644 --- a/recipes/foreign_policy.recipe +++ b/recipes/foreign_policy.recipe @@ -26,20 +26,19 @@ class ForeignPolicy(BasicNewsRecipe): keep_only_tags = [ dict(name='h1'), - classes('dek-heading meta-data figure-image post-content-main'), + classes('dek-heading meta-data figure-image post-content-main bio-no-photo'), dict(attrs={'class': lambda x: x and set(x.split()).intersection( {'wide_header_bg', 'wide_header_text'})}), ] remove_tags = [ dict(name=['meta', 'link']), - dict(attrs={'class': ['fp-lightbox--overlay']}), - dict(attrs={'class': lambda x: x and 'share-links' in x}), + classes('share-links content-ungated -excerpt related-articles fp-lightbox--overlay more-text'), ] remove_tags_after = [classes('post-content-main')] def parse_index(self): soup = self.index_to_soup('https://foreignpolicy.com/the-magazine') - img = soup.find('img', src=True, attrs={'alt': lambda x: x and 'foreign-policy-cover' in x}) + img = soup.find('img', src=True, attrs={'alt': lambda x: x and '-cover' in x}) self.cover_url = img['src'] current_section = None amap = OrderedDict()