title: TypeError: unsupported operand type(s) for +: 'int' and 'Element'
body: <p>Good day 
  I'm getting an error whenever i try to run the python script below. Its suppose to give a sum of values extracted from an XML file.
  The Error message is:
  TypeError: unsupported operand type(s) for +: 'int' and 'Element'</p>
  
  <p>I've tried all options but the error still comes back. where am i going wrong?</p>
  
  <p>Source file:</p>
  
  <pre><code>&lt;commentinfo&gt;
  &lt;comments&gt;
  &lt;comment&gt;
  &lt;name&gt;TDK&lt;/name&gt;
  &lt;count&gt;5000&lt;/count&gt;
  &lt;/comment&gt;
  &lt;comment&gt;
  &lt;name&gt;Swats&lt;/name&gt;
  &lt;count&gt;420&lt;/count&gt;
  &lt;/comment&gt;
  &lt;comment&gt;
  &lt;name&gt;Tandwa&lt;/name&gt;
  &lt;count&gt;2000&lt;/count&gt;
  &lt;/comment&gt;
  &lt;/comments&gt;
  &lt;/commentinfo&gt;
  </code></pre>
  
  <p>Python Code:</p>
  
  <pre><code>import urllib
  import re
  import xml.etree.ElementTree as ET
  u = urllib.urlopen('file.xml')
  data = u.read()
  print 'Retrieved',len(data),'characters'
  tree = ET.fromstring(data)
  lst = tree.findall('comments/comment')
  print 'Value', len(lst)
  score=[]
  for item in lst:
      number=int(item)
      score.append(number)
      total=int(sum(score))
  print 'Sum', total
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 12, in &lt;module&gt;
      number=int(item)
  TypeError: int() argument must be a string or a number, not 'Element'
  </code></pre>