Parse feeds in Python
I have encountered an issue when using the feedparser library to parse RSS directly from a URL. For example: ``` >>> feedparser.parse('https://hackernewsrss.com/feed.xml').keys() dict_keys(['bozo', 'entries', 'feed', 'headers', 'bozo_exception']) >>> d = feedparser.parse('https://hackernewsrss.com/feed.xml') >>> d['feed']['title'] ``` This results in the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/feedparser/util.py", line 113, in __getitem__ return dict.__getitem(self, key) KeyError: 'title' ``` However, when I download the XML file to my local system and parse it using feedparser's local file reading method, it works correctly, as shown below: ``` >>> d = feedparser.parse(r'./a.xml') >>> d['feed']['title'] 'Hacker News: New Comments' >>> d['feed']['links'] [{'rel': 'alternate', 'type': 'text/html', 'href': 'https://news.ycombinator.com/newcomments'}] ``` I believe this may be a potential bug, as it should be possible to parse content directly from an RSS URL. I would appreciate it if this issue could be addressed. Thank you!
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by bdim404 and has received 3 comments.