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

not able to retrieve categories #264

Open
cyril36 opened this issue Feb 5, 2021 · 0 comments
Open

not able to retrieve categories #264

cyril36 opened this issue Feb 5, 2021 · 0 comments

Comments

@cyril36
Copy link

cyril36 commented Feb 5, 2021

Hi,

I am using Python 3.8.3 and feedparser==6.0.2
I have the following feed :

<channel>
                <atom:link href="http://joeroganexp.joerogan.libsynpro.com/rss" rel="self" type="application/rss+xml"/>
		<title>The Joe Rogan Experience</title>
		<pubDate>Fri, 27 Nov 2020 18:00:00 +0000</pubDate>
		.....
		<itunes:author>Joe Rogan</itunes:author>
		<itunes:keywords>comedian,joe,monkey,redban,rogan,talking,ufc</itunes:keywords>
		<itunes:category text="Comedy"/>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:category text="Technology"/>
		<itunes:explicit>yes</itunes:explicit>
		<itunes:owner>
			<itunes:name><![CDATA[Joe Rogan]]></itunes:name>
			<itunes:email>joe@joerogan.net</itunes:email>
		</itunes:owner>
		<description><![CDATA[Conduit to the Gaian Mind]]></description>
		<itunes:subtitle><![CDATA[Joe Rogan's Weekly Podcast]]></itunes:subtitle>
		<itunes:type>episodic</itunes:type>
       <items>
          ...............
  1. I want to retrieve the "categories" independently of "keywords"
  2. I want to retrieve "author" independently of "itunes:owner"

First 1)

When I do the following to get one category it works , ut i can not retrieve the other categories:

            NewsFeed = feedparser.parse("http://rss_ul")
            print(NewsFeed.feed.category)

When I do the following to get several categories i get an error:

            NewsFeed = feedparser.parse("http://rss_ul")
            print(NewsFeed.feed.categories)

ERROR :

return dict.__getitem__(self, key)
KeyError: 'categories

I can retrieve the categories through the "tags" key, such as
NewsFeed.feed.get("tags")
but "tags" contains the "keywords" and "categories".
such as :

{
        "term": "comedian",
       ...
    },
    {
        "term": "joe",
        ...
    },
   ...
    {
        "term": "Comedy",  
        ...
    },
    {
        "term": "Society & Culture",
        ...
    },
    {
        "term": "Technology",
        ...
}

I want "categories" separated from "keywords".

  1. same for "author" independently of "itunes:owner"

i would like to know if there is a feature where i can parse a single tag?

Thank you

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