Jump to content

Python: Feedparser published_parsed cannot access CNN's RSS pubDate

Dobbsjr

I'm currently making an RSS reader, and every other RSS feed I've tried has worked, but my site crashes every time a CNN feed is inputted. The parsed items are put into a list and sorted by pubDate.

for source in sources: 
	rss = feedparser.parse(source.url) 
    
	try: 
		items.extend(rss["items"]) 
	except KeyError: 
		continue 
        
items = list(reversed(sorted(items, key=lambda item: item["updated_parsed"])))

Is there a problem with my code or is it CNN's feed?

Did my post help you? Then make sure to rate it!

Check out my post on symbolic links! || PSU ranking and tiers || Pokemon Thread

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×