Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from urllib2 import urlopen
from BeautifulSoup import BeautifulSoup
data = urlopen('''''').read()
soup = BeautifulSoup(data)
table = soup.find('table', {'summary': "valeurs mensuelles et annuelles"})
for tr in table.findAll('tr'):
line = []
for td in tr.findAll('td'):
line.append(td.find('input', {'name':'value'})['value'])
except TypeError:
print ','.join(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment