title: Extract number from a website using beautifulsoup in Python
body: <p>I am trying to use urllib to grab a html page, then use beautifulsoup to extract data out. I want to get all the number from comments_42.html and print out the sum of them, then display the numbers of data. 
  Here is my code, I am trying to use regex, but it doesn't work for me.</p>
  
  <pre><code>import urllib
  from bs4 import BeautifulSoup
  url = 'http://python-data.dr-chuck.net/comments_42.html'
  html = urllib.urlopen(url).read()
  soup = BeautifulSoup(html,"html.parser")
  tags = soup('span')
  for tag in tags:
      print tag
  </code></pre>