Quantcast
Channel: Active questions tagged atom-feed+rss+xml-parsing - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Unable to parse RSS feed using python, but other RSS feed apps in chrome can parse data

$
0
0

I'm working on a basic python script that parses RSS Feed data from the SEC.gov website, but it fails when I run the script. Where am I going wrong?

The version of Python I'm using is 3.6.5, and I've tried using the libraries Atoma and feedparser, but I'm unable to pull any SEC RSS data successfully. To be honest it could be that the format of the rss feed data is not in a valid format(I checked https://validator.w3.org/feed/ and it shows that the data is invalid). But when I try the same line in a Google Chrome RSS feed extension it works, so I must be doing something wrong. Does anyone know how to fix the issue with the format or am I going about it in the wrong way in Python?

import atoma, requestsfeed_name = "SEC FEED"url ='https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=0001616707&type=&dateb=&owner=exclude&start=0&count=100&output=atom'response = requests.get(url)feed = atoma.parse_rss_bytes(response.content)for post in feed.items:  date = post.pub_date.strftime('(%Y/%m/%d)')  print("post date: "+ date)  print("post title: "+ post.title)  print("post link: "+ post.link)

Viewing all articles
Browse latest Browse all 5

Trending Articles



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