You are not logged in.
Hi,
I have been following some python examples on how to parse XML. I started out on an example XML (pulled from a tutorial website)
By putting the "example.xml" into this script:
http://ix.io/9JY which successfully returns the values: 1, 4 and 68
However, putting it through a similar, yet a biiiit more complex example, which is the XML returned from a mail atom feed:
http://ix.io/9JT no results get returned.
Of course, I have changed the file name from example.xml to mail.xml, and instead of using country, which I am not interested in, I am 'entry', hoping that, for each entry, I am able to extract the title and author. (http://ix.io/9JZ)
With this slight alteration, I do not get a single output. The program just termites silently.
Any pointers would be appreciated.
Last edited by 3xOSC (2014-01-09 06:55:40)
Offline
You probably are having problems because you are not handling the namespaces correctly:
See lxml tutorial for more info.
(lxml shares a common API with elementree, but the doc is much nicer, IMHO)
By the way, if your end goal is to parse atom feeds, I suggest you have a look at feedparser
Hope this helps
Offline
My end goal is to parse atom feeds. I took a look at the feedparser and it came with EVERYTHING i needed and more.
It did help. Thank you SO much Yannick.
Last edited by 3xOSC (2014-01-09 06:55:57)
Offline