title: How write following code without regular expression
body: <p>i wrote the following code for extracting the all no. from the web page &amp; add all of them.but i want to code it without using regular expression so, please Guid me how to do it.
  link:<a href="http://python-data.dr-chuck.net/comments_361585.html" rel="nofollow noreferrer">http://python-data.dr-chuck.net/comments_361585.html</a> </p>
  
  <p>my code :</p>
  
  <pre><code>import urllib
  import re
  from BeautifulSoup import *
  
  html = urllib.urlopen('http://python-data.dr-chuck.net/comments_361585.html ').read()
  
  soup = BeautifulSoup(html)
  
  # Retrieve all of the anchor tags
  tags = soup('td')
  
  total = 0
  for tag in tags:
  # Look at the parts of a tag
        line = str(tag)
        x = re.findall('[0-9]+',line)
        if len(x) &gt; 0:
             for item in x:
                  total += int(item)
  
  print(total)
  </code></pre>
  
  <p>With out using regex i tried this: </p>
  
  <pre><code>import urllib
  from BeautifulSoup import *
  
  url = raw_input('Enter - ')
  html = urllib.urlopen(url).read()
  soup = BeautifulSoup(html)
  
  
  tags = soup.find_all('span', text=True)
  
  for tag in tags:
          number=tag.get('class', None)
          total = sum( int(tag.text) for tag in tags )
  
  print ('total')
  </code></pre>
  
  <p>but it having some error: 'NoneType' Object Is not Callable.</p>
  
  <p>guide me how i fix it.</p>