HaveF / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

Cannot obtain content of namespaced (Atom) elements #420

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. feed = 
feedparser.parse(u"https://itunes.apple.com/us/rss/topsongs/limit=100/genre=17/e
xplicit=true/xml")
2. feed.entries[0].im_artist

What is the expected output? What do you see instead?

I would expect to see the cnotent of the im:artist element, that is, something 
like: 
"DJ Snake & Lil Jon" (depending on the song that's 1st in the iTunes list right 
now). Instead, I see the detail of the im:artist tag.
That is: 
{'href': u'https://itunes.apple.com/us/artist/dj-snake/id125742557?uo=2'}

Trying to get the detail of the im:artist element (with 
feed.entries[0].im_artist_detail) throws an AttributeError

What version of the product are you using? On what operating system?

Using latest version, 5.1.3

Original issue reported on code.google.com by robertso...@gmail.com on 19 Jan 2014 at 12:27

GoogleCodeExporter commented 9 years ago
Thanks for reporting this! This is a known issue. feedparser's current behavior 
for unknown elements is to use the text of the tag (if there are no attributes) 
or to present the attributes in a dictionary if the tag has attributes.

feedparser will not become a general DOM parser (that is, it won't parse 
everything into nested dictionaries). Nevertheless, I'll tackle this as I have 
time!

Original comment by kurtmckee on 10 Jul 2014 at 4:42