title: How do I get the numbers out of this piece of data?
body: <p>I've been given an assignment where I have to extract the numbers out of <a href="https://pr4e.dr-chuck.com/tsugi/mod/python-data/data/comments_42.xml" rel="nofollow noreferrer">this xml file</a> and then sum them up. The problem is I'm getting an attribute error when I try to do a for loop to get at the data: </p>
  
  <blockquote>
    <p>TypeError: 'NoneType' object is not callable</p>
  </blockquote>
  
  <p>Here's my code so far:</p>
  
  <pre><code>import urllib
  import xml.etree.ElementTree as ET
  
  url = raw_input('Enter location: ')
  print 'Retrieving', url
  uh = urllib.urlopen(url)
  data = uh.read()
  print 'Retrieved',len(data),'characters'
  tree = ET.fromstring(data)
  lst = tree.findall('.//count')
  print 'Count:', len(lst)
  for item in lst:
      print 'name', item.find('count').text 
  </code></pre>
  
  <p>I should be extracting text from inside the count tag:</p>
  
  <pre><code>&lt;comment&gt;
    &lt;name&gt;Matthias&lt;/name&gt;
    &lt;count&gt;97&lt;/count&gt;
  &lt;/comment&gt;
  </code></pre>
  
  <p>Is there something I'm missing here?</p>