kurtmckee/feedparser

Example "Accessing multiple categories" in the documentation fails

thomasmoor opened this issue · 2 comments

Hi,

It looks like there has been a change on "multiple categories".

The example "Accessing multiple categories" in the documentation (https://feedparser.readthedocs.io/en/latest/uncommon-rss.html) does not work.

Here is the result of my test:

import feedparser
d = feedparser.parse('http://feedparser.org/docs/examples/rss20.xml')
d.feed.categories
Traceback (most recent call last):
File "C:\Python3\lib\site-packages\feedparser\util.py", line 156, in getattr
return self.getitem(key)
File "C:\Python3\lib\site-packages\feedparser\util.py", line 113, in getitem
return dict.getitem(self, key)
KeyError: 'categories'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Python3\lib\site-packages\feedparser\util.py", line 158, in getattr
raise AttributeError("object has no attribute '%s'" % key)
AttributeError: object has no attribute 'categories'

I just installed feedparser. I am on version 6.0.8

Categories are important for me
Thanks

It seems the domain name expired ??, well when you hit that link it doesn't contain the expected xml example, so the parsed feed is whatever is hosted there and fails.

Edit: I don't know if it was the same case when you tried it

This should be fixed now.