Skip to content

Instantly share code, notes, and snippets.

@diegorocha
Created February 9, 2015 13:54
Show Gist options
  • Save diegorocha/7dbf0f4627006aebcdde to your computer and use it in GitHub Desktop.
Save diegorocha/7dbf0f4627006aebcdde to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import requests
import BeautifulSoup
#Faz a requisição
req = requests.get('http://pcdsh01.on.br/HoraLegalBrasileira.asp')
#Obtem os dados no HTML
soup = BeautifulSoup.BeautifulSoup(req.text)
hora_legal = soup.find('td', {'bgcolor': '#FFFF00'}).text
#Utiliza o dado
print 'Hora Legal Brasileira : %s' % (hora_legal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment