Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feedparser cannot parse multiple "category" value? #40

Open
t2y opened this issue Nov 11, 2015 · 1 comment
Open

feedparser cannot parse multiple "category" value? #40

t2y opened this issue Nov 11, 2015 · 1 comment

Comments

@t2y
Copy link

t2y commented Nov 11, 2015

According to RSS 2.0 Specification, category item may include multiple values.

You may include as many category elements as you need to, for different domains, and to have an item cross-referenced in different parts of the same domain.

There's a sample including multiple category values as below.

>>> import feedparser
>>> feedparser.__version__
'5.2.1'
>>> data = feedparser.parse('http://www.validome.org/check/RSS_validator/version/rss_2_0/action/xml/feed/234')
>>> data.feed.get('category')
u'category/subcategory/subcategory2'

Is this a bug?

@t2y
Copy link
Author

t2y commented Nov 12, 2015

I found tags handles multiple category values. We have a workaround.

>>> data.feed.get('tags')
[{'label': None,
  'scheme': u'http://www.validome.org/cat1/',
  'term': u'category/subcategory/subcategory2'},
 {'label': None,
  'scheme': u'http://www.validome.org/cat2',
  'term': u'category/subcategory/subcategory3'}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant