Last active
September 12, 2020 23:52
-
-
Save gilsonbp/be5a0b271d8b45be99da9000eb1337b1 to your computer and use it in GitHub Desktop.
Acessando as licitações do dia
This file contains hidden or 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 requests | |
from bs4 import BeautifulSoup as bs | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
# Desabilitando Warnings | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
url = 'http://comprasnet.gov.br/ConsultaLicitacoes/ConsLicitacao_Relacao.asp?numprp=&dt_publ_ini=11/05/2018&dt_publ_fim=11/05/2018&chkModalidade=5&chk_concor=&chk_pregao=1,2,3,4&chk_rdc=&optTpPesqMat=M&optTpPesqServ=S&chkTodos=&chk_concorTodos=&chk_pregaoTodos=-1&txtlstUf=&txtlstMunicipio=&txtlstUasg=&txtlstGrpMaterial=&txtlstClasMaterial=&txtlstMaterial=&txtlstGrpServico=&txtlstServico=&txtObjeto=' | |
# Acessando a URL sem verificar autenticidade do certificado SSL | |
response = requests.get(url, verify=False) | |
# Analisando o HTML com o BeautifulSoup usando o html.parser | |
soup = bs(response.text, 'html.parser') | |
# Selecionando todos os itens que contem a tag 'form' | |
forms = soup.find_all('form') | |
# Navegando em cada item e imprimindo na tela o texto dentro da tag 'b' | |
for form in forms: | |
print(form.find('b').getText().strip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment