Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- from BeautifulSoup import BeautifulSoup
- rawhtml = urllib.urlopen("http://www.01.ign.es/ign/layoutIn/sismoListadoTerremotos.do?zona=1&cantidad_dias=10").read()
- parsedhtml = BeautifulSoup(''.join(rawhtml))
- qtable = parsedhtml.find('table')
- rows = qtable.findAll('tr')
- for tr in rows:
- cols = tr.findAll('td')
- for td in cols:
- text = ''.join(td.find(text=True)).replace(' ',' ').strip()
- print text+"\t",
- print
Advertisement
Add Comment
Please, Sign In to add comment