Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
Correção na verificação do HEADER retorno
Browse files Browse the repository at this point in the history
  • Loading branch information
caputchinefrobles committed Aug 6, 2019
1 parent 1ed87af commit 1067fc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Script que pesquisa no Diário Oficial da União termos de interesse e notifica
- smtplib
- urllib3
- mailer
- chardet (pdfminer)

`pip install pdfminer.six urllib3 mailer`
`pip install pdfminer.six urllib3 mailer chardet`

## Utilização

Expand Down
2 changes: 1 addition & 1 deletion classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def processar(self, jornal, pagina_inicio=1, pagina_fim=1100, extra=False):
print(full_url)
response = http.request('GET', full_url, headers=header)

if 'text/html' not in response.headers['Content-Type'] and response.headers['Content-Encoding'] == 'gzip':
if response.headers['Content-Type'] == 'application/pdf':
buff = response.data
arquivo = io.BytesIO(buff)
texto = extrair_texto(arquivo).upper()
Expand Down

0 comments on commit 1067fc8

Please sign in to comment.