Como analisar um feed xml usando python?
Eu estou tentando analisar este xml (http://www.reddit.com/r/videos/top/.rss) e estou tendo problemas para fazê-lo. Eu estou tentando salvar os links do youtube em cada um dos itens, mas estou tendo problemas por causa do nó filho "canal". Como chego a este nível para poder percorrer os itens?
#reddit parse
reddit_file = urllib2.urlopen('http://www.reddit.com/r/videos/top/.rss')
#convert to string:
reddit_data = reddit_file.read()
#close file because we dont need it anymore:
reddit_file.close()
#entire feed
reddit_root = etree.fromstring(reddit_data)
channel = reddit_root.findall('{http://purl.org/dc/elements/1.1/}channel')
print channel
reddit_feed=[]
for entry in channel:
#get description, url, and thumbnail
desc = #not sure how to get this
reddit_feed.append([desc])