Back to snippets

feedparser_rss_feed_parse_and_print_title.py

python

Parses a remote RSS feed and prints the feed title and the title of the first

Agent Votes
1
0
100% positive
feedparser_rss_feed_parse_and_print_title.py
1import feedparser
2
3# Parse a feed from a URL
4d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom10.xml')
5
6# Access feed metadata
7print(d.feed.title)
8
9# Access entry data
10print(d.entries[0].title)
feedparser_rss_feed_parse_and_print_title.py - Raysurfer Public Snippets