This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import sys | |
import re | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import sys | |
import re | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import sys | |
def captura_html(url): | |
pass | |
def extrai_status(html): | |
pass | |
def obter_rastreamento(codigo): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gráficos 3D | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import cm | |
from matplotlib.ticker import LinearLocator, FormatStrFormatter | |
import matplotlib.pyplot as plt | |
import numpy as np | |
fig = plt.figure() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from BeautifulSoup import BeautifulSoup | |
import urllib | |
import re | |
def extract_price(url): | |
dados = urllib.urlopen(url).read() | |
return re.findall(r'R\$\s*[a-z<> ]*([1-9][0-9,]+)', dados) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import datetime as dt_variation | |
from datetime import datetime | |
DELTA = dt_variation.timedelta(days=2) | |
DATAS = ['2012-02-08', '2012-02-09', '2012-02-10', '2012-02-11', '2012-02-12'] | |
PONTO_MOVIMENTO = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import datetime as dt_variation | |
from datetime import datetime | |
DELTA = dt_variation.timedelta(days=2) | |
DATAS = ('2012-02-08', '2012-02-09', '2012-02-10', '2012-02-11', '2012-02-12') | |
PONTO_MOVIMENTO = '' | |
def Gera_Data(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import mechanize | |
br = mechanize.Browser() | |
br.open("http://www.bmfbovespa.com.br/opcoes/opcoes.aspx?Idioma=pt-br") | |
br.select_form(nr=0) | |
response = br.submit(name='ctl00$contentPlaceHolderConteudo$posicoesAbertoEmp$btnBuscarArquivos') | |
f = open("teste.dat", "w") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanize | |
br = mechanize.Browser() | |
br.open("http://www.bmfbovespa.com.br/opcoes/opcoes.aspx?Idioma=pt-br") | |
br.select_form(nr=0) | |
# data/hora yyyy-mm-dd-hh-mm-ss | |
br["ctl00$contentPlaceHolderConteudo$posicoesAbertoEmp$txtConsultaDataDownload$txtConsultaDataDownload$dateInput"] = "2012-02-22-00-00-00" | |
response = br.submit(name='ctl00$contentPlaceHolderConteudo$posicoesAbertoEmp$btnBuscarArquivos') | |
f = open("teste.dat", "w") |