How to read all articles from a RSS feed?

northtree picture northtree · Aug 10, 2012 · Viewed 10.7k times · Source

I am using Python feedparser to read articles from a RSS feed. However, only the first page of articles can be read. Is there any other lib/package can read all articles of a RSS feed?

Similar question @ SO: Feedparser - retrieve old messages from Google Reader

Answer

lazy1 picture lazy1 · Aug 10, 2012

The RSS itself has probably just the first page of data. You can access the original data from the 'link' attribute in the RSS item (at least that what it's called in feedparser). Something like:

feed = feedparser.parse('http://reddit.com/.rss')
for entry in feed['entries']:
    content = urlopen(entry['link']).read()
    # Do something with content