View Single Post
Old 10-18-2016, 09:17 AM   #3
anleva
Enthusiast
anleva began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Nov 2011
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
Code:
keep_only_tags = dict(attrs={'class':'asset story clearfix'})

def preprocess_raw_html(self, html, url):
    if '<article class="asset clearfix">' in html:
         self.abort_article()
    return html
Thank you I will try this. If I also add the remove_tag with additional attributes does it matter where it is placed in the recipe? Same with auto_cleanup?
anleva is offline   Reply With Quote