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

should entry.tags be defined even when empty? #319

Open
JoeGermuska opened this issue Jul 12, 2022 · 1 comment
Open

should entry.tags be defined even when empty? #319

JoeGermuska opened this issue Jul 12, 2022 · 1 comment

Comments

@JoeGermuska
Copy link

I have two different RSS feeds, both of which have a number of elements at the xpath /rss/channel/item/category, which, according to the docs, is one source for tags (categories) on elements.

However, when feedparser parses them, entries from one have tags, and entries from the other do not.

This feed, https://seekingalpha.com/feed.xml, comes up with plentiful tags, even though the RSS does not validate
This feed, https://rss.nytimes.com/services/xml/rss/nyt/World.xml, throws AttributeError when entry.tags is accessed, even though the RSS does validate.

Am I missing something? Is it a bug?

@JoeGermuska JoeGermuska changed the title Mixed results using entry.tags with similar feeds entry.tags should be defined even when empty Jul 13, 2022
@JoeGermuska JoeGermuska changed the title entry.tags should be defined even when empty entry.tags should be defined even when empty? Jul 13, 2022
@JoeGermuska JoeGermuska changed the title entry.tags should be defined even when empty? should entry.tags be defined even when empty? Jul 13, 2022
@JoeGermuska
Copy link
Author

My bad... I didn't read the feed XML carefully, and it just so happened that the first element in the NYT feed didn't have categories.

So I guess I was surprised that the parsed feed entry throws AttributeException when there are no tags, instead of returning an empty list.

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