diff --git a/recipes/politico.recipe b/recipes/politico.recipe index db7ebfc3cd..b0cd4dc43a 100644 --- a/recipes/politico.recipe +++ b/recipes/politico.recipe @@ -35,8 +35,22 @@ class Politico(BasicNewsRecipe): html2epub_options = 'publisher="' + publisher + '"\ncomments="' + \ description + '"\ntags="' + category + '"\nlinearize_tables=True' + keep_only_tags = [ + dict(name=['article']), + ] + remove_tags = [ - dict(name=['notags', 'embed', 'object', 'link', 'img']), + dict(name=['notags', 'embed', 'aside', 'object', 'link', 'img', 'figure']), + dict( + attrs={'class': lambda x: x and 'story-tools' in x.split()}), + dict( + attrs={'class': lambda x: x and 'story-continued' in x.split()}), + dict( + attrs={'class': lambda x: x and 'story-supplement' in x.split()}), + dict( + attrs={'class': lambda x: x and 'story-share' in x.split()}), + dict( + attrs={'class': lambda x: x and 'suggested' in x.split()}), ] extra_css = ''' @@ -70,19 +84,8 @@ class Politico(BasicNewsRecipe): del item['style'] return soup - url_pat = re.compile(r'