<markets xmlns="http://www.eoddsmaker.net/schemas/markets/1.0" D="2015-03-23T23:12:34" CNT="1521">
<S I="50" N="Football">
<C I="65" N="Russia">
<L I="167" N="Premier League">
<E I="1049367" DT="2015-04-05T15:00:00" ISH="0" BKS="20" T1="Ufa" T2="Terek Groznyi" T1I="79698" T2I="44081">
<M K="1x2">
<B I="81" BTDT="2015-03-23T23:04:00,825">
<O N="1" V="3"/>
<O N="X" V="3.1"/>
<O N="2" V="2.25"/>
</B>
</M>
</E>
</L>
</C>
</S>
</markets>
I am trying to parse this XML using etree in Python. I have done XML parsing before but the documents have always been in the format.
<tag> value </tag>
I am unsure how to isolate the "D" from "Markets" as well as all the other values.
This is how I open and parse the XML Doc:
z = gzip.open("code2.zip", "r")
tree = etree.parse(z)
print(etree.tostring(tree, pretty_print=True))
I tried:
for markets in tree.findall('markets'):
print "found"
However this doesn't work. I would appreciate some tips/advice. Hopefully once I get the first "D" extracted I'll be able to get the rest.