0

I am trying to get the data from a rss feed using python 3.7.7 and feedparser.

I am able to get the simple information like feed['title'] but I am unable to get feed['ht:approx_traffic'] which is one of the tags that I want.

import feedparser

def getFeed():
    feed = feedparser.parse('https://trends.google.com/trends/trendingsearches/daily/rss?geo=US')
    for post in feed.entries:  
        print(post['title']) // works
        print(post['ht:approx_traffic']) // error


getFeed()

1 Answer 1

1

The key that you're looking for is ht_approx_traffic not ht:approx_traffic.

You can see the list of keys with

print(post.keys())
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.