Quote:
Originally Posted by hackettt
Kovid and Darko —
Is there something I must do besides eliminating the code for other sections I do not want?
|
You are complicating things without real need. This is what you need to change in your recipe:
Code:
class AdvancedUserRecipe1249153260(BasicNewsRecipe):
title = u'DailyMail'
oldest_article = 2
max_articles_per_feed = 100
no_stylesheets = True
encoding = 'cp1252'
keep_only_tags = [dict(name='div', attrs={'id':'js-article-text'})]
remove_tags = [dict(name='div', attrs={'class':['relatedItems','article-icon-links-container']})]
remove_tags_after = dict(name='h3', attrs={'class':'social-links-title'})
feeds = [(u'Sports', u'http://www.dailymail.co.uk/sport/index.rss')]
def print_version(self, url):
main = url.partition('?')[0]
return main + '?printingPage=true'