I want to parse the following xml file using python. My "folder" variable is set up to always equal the 8-digit number towards the end of the <link> tag. In this case it is 11119709.
Python
for folder in folderList:
I want to be able to say, when "folder" equals the last 8 digits in the link tag, give me what the eq:seconds value is. I tried playing with the code provided by python docs element tree, but I am having trouble with it because there are so many hierarchies. root[0][1].text will not retrieve variables under the item tag.
XML
-<rss xmlns:georss="http://www.georss.org/georss/" xmlns:eq="http://earthquake.usgs.gov/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
-<channel>
<title>USGS Earthquake ShakeMaps</title>
<description>List of ShakeMaps for events in the last 30 days</description>
<link>http://earthquake.usgs.gov/</link>
<dc:publisher>U.S. Geological Survey</dc:publisher>
<pubDate>Thu, 27 Mar 2014 15:33:05 +0000</pubDate>
<item>
<title>4.11 - 79.3 miles NNW of Kotzebue</title>
<description>
<![CDATA[<img src="http://earthquake.usgs.gov/eqcenter/shakemap/thumbs/shakemap_ak_11199709.jpg" width="100" align="left" hspace="10"/><p>Date: Thu, 27 Mar 2014 07:28:31 UTC<br/>Lat/Lon: 67.9858/-163.494<br/>Depth: 15.9122</p>]]></description>
<link>http://earthquake.usgs.gov/eqcenter/shakemap/ak/shake/11199709/</link>
<pubDate>Thu, 27 Mar 2014 07:53:33 +0000</pubDate>
<geo:lat>67.9858</geo:lat>
<geo:long>-163.494</geo:long>
<dc:subject>4</dc:subject>
<eq:seconds>1395905311</eq:seconds>
<eq:depth>15.9122</eq:depth>
<eq:region>ak</eq:region>
</item>
<item>
...similar to above item