Quantcast
Channel: Parse entries that is within specified date using feedparser - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by EvenLisle for Parse entries that is within specified date using feedparser

$
0
0

I haven't been able to find any way of providing a query parameter specifying date interval, so I'm afraid you'll have to retrieve all entries and filter them by date afterwards:

import feedparser
d = feedparser.parse('http://www.reddit.com/r/Python/.rss')
for entry in d.entries:
  date = entry.published_parsed
  if date.tm_year == 2015 and date.tm_mon == 4 and date.tm_mday >= 15 and date.tm_mday <= 16:
    print entry.title

Viewing all articles
Browse latest Browse all 2

Trending Articles



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