Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Created June 4, 2012 05:12
Show Gist options
  • Save marcelcaraciolo/2866483 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/2866483 to your computer and use it in GitHub Desktop.
crawler_p2.py
import urllib
import sys
URL = 'http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_ITEMCODE=&P_LINGUA=001&P_TESTE=&P_TIPO=001&P_COD_UNI=%s'
def captura_html(url):
html_data = urllib.urlopen(url).read()
return html_data
def extrai_status(html):
pass
def obter_rastreamento(codigo):
html_data = captura_html(URL % codigo)
print html_data
if __name__ == '__main__':
codigo = sys.argv[1]
status = obter_rastreamento(codigo)
print 'status', status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment