


This is how we handle exceptions in providing the keys when there are multiple feeds to be extracted though they are quite similar, they will have subtle changes like this that need to be handled and taken care of.įrom this little article, we were able to understand and use the feedparser Python package which can be used to extract information from different feeds. For example, all the latest posts from a given blog can be accessed on a list in python, further different attributes like links, images, titles, descriptions, can be accessed within a dictionary as key-value pairs.Īs feedparser is a python package you can install it with pip very easily.Įnter fullscreen mode Exit fullscreen modeĪs we can see we do not have an image key in the second RSS feed which means each entry doesn't have a unique cover image, so we have to fetch the image from the feed key then the image key in the entries list.Īs we can see here, the image_url will pick up the image key in the dictionary if it is present else we will assign it to another URL which is the website/podcast cover image. It is a package that allows us to parse or extract information using python semantics. Today, we will be taking a look at the feedparser package in python and how to extract information from a given RSS feed.įeedparser is a python package for parsing feeds of almost any type such as RSS, Atom, RDF, etc.

It can be basically used in a pythonic way to read RSS feeds, it is really simple to use and it even normalizes different types of feeds. By providing the RSS feed link, we can get structured information in the form of python lists and dictionaries. Feedparser is a simple but powerful python package that can be used to extract information about a specific webpage or a publication with its RSS feed(not only RSS).
