Search code examples
exceptionrsssaxparserfeedparser

Feedparser SAXParseException, bozo:1


I'm using feedparser in a script that's generally working for RSS URLs, but there's one URL that's giving me a headache: tabbforum.com/feed.atom

I get a SAXParseException('not well-formed (invalid token)',).

import feedparser

def read_from_feed(self, rss_url):
    feed = feedparser.parse(rss_url)
    for entry in feed.entries:
        print('do stuff')


>>>>feed
{'feed': {}, 'entries': [], 'bozo': 1, 'encoding': 'utf-8', 'version': '', 'bozo_exception': SAXParseException('not well-formed (invalid token)',), 'namespaces': {}}

I'm thinking that there's something wrong with the xml(?). Has anybody had previous experiences and have been able to find a work-around? Or have an idea what the problem is?


Solution

  • Had a similar problem. In my case I forgot to put http:// in front of URL and feedparser was treating it not as a url, but as an RSS XML.