kurtmckee / feedparser

Parse feeds in Python
https://feedparser.readthedocs.io/en/latest/
Other
1.89k stars 336 forks source link

Tolerant mode for feeds with no link elements #442

Closed dmoklaf closed 2 months ago

dmoklaf commented 2 months ago

The Amazon Science feed has sometimes entries with no link element: https://www.amazon.science/index.rss

<item>
      <title>Amazon panel discusses fairness in AI</title>
      <description>Watch the recorded panel discussion that aired the week of NeurIPS 2020.</description>
      <pubDate>Wed, 25 Nov 2020 18:07:19 GMT</pubDate>
</item>

which triggers, logically, an exception in feedparser: AttributeError: object has no attribute 'link'

A tolerant mode for feedparser would greatly help, skipping these bad entries entirely, or tolerating entries with no link, depending on what disrupts the less the feedparser code (the only functional need is to be able to return the other valid entries).

dmoklaf commented 2 months ago

Wrong ticket. The issue was coming from my own downstream code. Sorry for the noise.