From c6d33d0addfb473740188e742191b9b94aea3f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Fri, 27 Oct 2017 23:02:29 +0200 Subject: [PATCH] fix computerworld.pl recipe --- recipes/computerworld_pl.recipe | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/recipes/computerworld_pl.recipe b/recipes/computerworld_pl.recipe index 91d19a62f3..a8eac7a37a 100644 --- a/recipes/computerworld_pl.recipe +++ b/recipes/computerworld_pl.recipe @@ -14,19 +14,13 @@ class Computerworld_pl(BasicNewsRecipe): no_stylesheets = True oldest_article = 7 max_articles_per_feed = 100 - remove_attributes = ['style', ] use_embedded_content = False preprocess_regexps = [(re.compile(u'Zobacz również:', re.IGNORECASE), lambda m: ''), (re.compile(ur'[*]+reklama[*]+', re.IGNORECASE), lambda m: ''), ] - keep_only_tags = [dict(id=['article-default-body'])] - remove_tags = [dict(attrs={'class': ['share_tools nocontent', 'rec']}), dict( - id=['topComment', 'bottom_tools'])] + keep_only_tags = [dict(name='article')] + remove_tags = [dict(attrs={'class': ['share_tools nocontent', 'rec']}), + dict(name='ul',attrs={'class':'tags'}), + dict(name='ol'), + dict(id=['topComment', 'bottom_tools'])] - feeds = [(u'Wiadomo\u015bci', u'http://rssout.idg.pl/cw/news_iso.xml')] - - def skip_ad_pages(self, soup): - if soup.title.string.lower() == 'advertisement': - tag = soup.find(name='a') - if tag: - new_soup = self.index_to_soup(tag['href'], raw=True) - return new_soup + feeds = [(u'Wiadomo\u015bci', u'https://www.computerworld.pl/news?rss')]