Estoy con un curso y me piden que extraiga los numeros que aparecen en un texto
import urllib
from BeautifulSoup import *
import re
html=urllib.urlopen("
http://python-data.dr-chuck.net/comments_42.html").read()
soup=BeautifulSoup(html)
tags=soup("tr")
text=list()
for tag in tags:
text.append(tag)
print text
for n in re.findall("\d+",text):
print n
Estoy intentando usar las expresiones regulares, pero no entiendo cual es el problema.