
Today I came across this python library feedparser that is used to parse rss, atom feeds.
How to use install feedparser?
Install feedparser using pip.
pip install feedparser
How to use feed parser?
import feedparser
feed = feedparser.parse("http://feeds.feedburner.com/PythonInsider")
feed_title = feed['feed']['title']
feed_entries = feed.entries
for entry in feed.entries:
article_title = entry.title
article_link = entry.link
article_published_at = entry.published # Unicode string
article_published_at_parsed = entry.published_parsed # Time object
article_author = entry.author
print "{}[{}]".format(article_title, article_link)
print "Published at {}".format(article_published_at)
print "Published by {}".format(article_author)
To know the list of rss feed attributes parsed by the library, see reference