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

Tenta baixar arquivo mesmo quando botão de edital não existe #43

Closed
anapaulagomes opened this issue Feb 1, 2020 · 2 comments · Fixed by #89
Closed

Tenta baixar arquivo mesmo quando botão de edital não existe #43

anapaulagomes opened this issue Feb 1, 2020 · 2 comments · Fixed by #89
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@anapaulagomes
Copy link
Contributor

anapaulagomes commented Feb 1, 2020

Erro: NotSupported: Unsupported URL scheme 'tel': no handler available for that scheme

Esse erro acontece quando um telefone é colocado como um <a> e o spider entende que é um arquivo (o código assume que os links no texto serão o edital). Para evitar esse erro, podemos: 1) verificar se é uma URL válida; 2) verificar se a imagem com o título "Baixar Edital" está presente.

Spider: cityhall_bids (licitações)

document_url = raw_description.xpath(".//@href").extract_first()

Botão esperado:
Baixar Edital

Exemplo: LICITAÇÃO Nº002-2020 PREGÃO ELETRÔNICO Nº001-2020 – FHFS.
http://www.feiradesantana.ba.gov.br/seadm/licitacoes_pm.asp?cat=FHFS&dt=02-2020#links

@anapaulagomes anapaulagomes added the bug Something isn't working label Feb 1, 2020
@anapaulagomes
Copy link
Contributor Author

anapaulagomes commented Feb 1, 2020

Esse bug não causa nenhum dano aos dados, apenas lança um erro nos logs. Seria interessante saber se todas as licitações devem ter um edital linkado às entradas no site ou não. A partir daí decidimos de continuamos lançando um erro ou mudamos pra um warning.

@anapaulagomes anapaulagomes added the good first issue Good for newcomers label Feb 2, 2020
@anapaulagomes
Copy link
Contributor Author

@rislamiranda 💪

@anapaulagomes anapaulagomes linked a pull request Apr 2, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant