title: Python (newbie) Parse XML from API call
body: <p>I've look for some tutorials/other questions on stack/documentation and still can't figure it out. ugh!!!</p>
  
  <p>Making the API request and the parsing out (want to assign to variables but that's a bonus to this question), This is what I'm trying. Why can't I list the title and link for the items?</p>
  
  <pre><code>#!/usr/bin/python
  
  # Screen Scraper for Subs
  import urllib
  from xml.etree import ElementTree as ET
  
  show = 'heroes'
  season = '4'
  language = 'en'
  limit = '1'
  
  requestURL = 'http://api.allsubs.org/index.php?' \
             + 'search=' + show \
             + '+season+' + season \
             + '&amp;language=' + language \
             + '&amp;limit=' + limit
  
  root = ET.parse(urllib.urlopen(requestURL)).getroot()
  print root
  print '\n'
  
  items = root.findall('items')
  for item in items: 
       item.find('title').text # should print: &lt;![CDATA[Heroes Season 4 Subtitles]]&gt;
       item.find('link').text # Should print: http://www.allsubs.org/subs-download/heroes+season+4/1223435/
  </code></pre>
  
  <p>XML Response</p>
  
  <pre><code>        &lt;AllSubsAPI&gt; 
          &lt;title&gt;AllSubs API: Subtitles Search&lt;/title&gt; 
          &lt;link&gt;http://www.allsubs.org&lt;/link&gt; 
          &lt;description&gt;&lt;![CDATA[Subtitles Search for Heroes Season 4]]&gt;&lt;/description&gt; 
          &lt;language&gt;en-us&lt;/language&gt; 
          &lt;results&gt;1&lt;/results&gt; 
          &lt;found_results&gt;24&lt;/found_results&gt; 
  &lt;items&gt; 
      &lt;item&gt; 
              &lt;title&gt;&lt;![CDATA[Heroes Season 4 Subtitles]]&gt;&lt;/title&gt; 
              &lt;link&gt;http://www.allsubs.org/subs-download/heroes+season+4/1223435/&lt;/link&gt; 
              &lt;filename&gt;heroes-season-4-english-heroes-season-4-en.zip&lt;/filename&gt; 
              &lt;files_in_archive&gt;Heroes - 4x01-02 - Orientation.HDTV.FQM.en.srt|Heroes - 4x17 - The Art of Deception.HDTV.2HD.en.srt|Heroes - 4x07 - Strange Attractors.HDTV.LOL.en.srt|Heroes - 4x08 - Once Upon a Time in Texas.HDTV.2HD.en.srt|Heroes - 4x07 - Strange Attractors.720p HDTV.DIMENSION.en.srt|Heroes - 4x05 - Hysterical Blindness.720p HDTV.X264.en.srt|Heroes - 4x09 - Shadowboxing.HDTV.LOL.en.srt|Heroes - 4x16 - Pass Fail.HDTV.LOL.en.srt|Heroes - 4x04 - Acceptance.HDTV.en.srt|Heroes - 4x01-02 - Orientation.720p HDTV.DIMENSION.en.srt|Heroes - 4x06 - Tabula Rasa.HDTV.NoTV.en.srt|Heroes - 4x10 - Brother's Keeper.HDTV.FQM.en.srt|Heroes - 4x04 - Acceptance.HDTV.FQM.en.srt|Heroes - 4x14 - Let It Bleed.720p HDTV.DIMENSION.en.srt|Heroes - 4x06 - Tabula Rasa.720p HDTV.SiTV.en.srt|Heroes - 4x08 - Once Upon a Time in Texas.HDTV.NoTV.en.srt|Heroes - 4x12 - The Fifth Stage.HDTV.LOL.en.srt|Heroes - 4x19 - Brave New World.HDTV.LOL.en.srt|Heroes - 4x15 - Close to You.720p HDTV.DIMENSION.en.srt|Heroes - 4x03 - Ink.720p HDTV.DIMENSION.en.srt|Heroes - 4x11 - Thanksgiving.720p HDTV.DIMENSION.en.srt|Heroes - 4x13 - Upon This Rock.720p HDTV.DIMENSION.en.srt|Heroes - 4x13 - Upon This Rock.HDTV.LOL.en.srt|Heroes - 4x14 - Let It Bleed.HDTV.LOL.en.srt|Heroes - 4x15 - Close to You.HDTV.LOL.en.srt|Heroes - 4x12 - The Fifth Stage.720p HDTV.DIMENSION.en.srt|Heroes - 4x18 - The Wall.HDTV.LOL.en.srt|Heroes - 4x08 - Once Upon a Time in Texas.720p HDTV.CTU.en.srt|Heroes - 4x17 - The Art of Deception.HDTV.CTU.en.srt|Heroes - 4x09 - Shadowboxing.720p HDTV.DIMENSION.en.srt|Heroes - 4x10 - Brother's Keeper.720p HDTV.DIMENSION.en.srt|Heroes - 4x04 - Acceptance.720p HDTV.CTU.en.srt|Heroes - 4x11 - Thanksgiving.HDTV.FQM.en.srt|Heroes - 4x03 - Ink.HDTV.FQM.en.srt|Heroes - 4x05 - Hysterical Blindness.HDTV.XII.en.srt|&lt;/files_in_archive&gt; 
              &lt;languages&gt;en&lt;/languages&gt; 
              &lt;added_on&gt;2010-02-16&lt;/added_on&gt; 
      &lt;/item&gt; 
  
  &lt;/items&gt; 
  &lt;/AllSubsAPI&gt;
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>This worked, thanks for the help and pointing out my typo</p>
  
  <pre><code>items = root.findall('items/item')
  for item in items: 
       print item.find('title').text
       print item.find('link').text
  </code></pre>