Quantcast
Channel: Active questions tagged feedparser+rss+python-2.7 - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Is there a way in feedparser to retrieve only X number of entries from a feed URL?

$
0
0

I need to fetch the last 3 feeds from a feed url and display. The code that i'm currently using is :

import feedparser

feedUrl = ""

feed = feedparser.parse( feedUrl )

length = len(feed['entries']) 
stop =  (length-4) if length > 3 else -1

for i in range(length-1, stop, -1):
    print feed['items'][i]['title'] + " " + feed['items'][i]['link']

Is there a way using ETags and/or Last-Modified headers to accomplish this?


Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>