-
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mg_belohorizonte #33
mg_belohorizonte #33
Conversation
@@ -7,4 +7,4 @@ | |||
'gazette.pipelines.PdfParsingPipeline': 2, | |||
'gazette.pipelines.PostgreSQLPipeline': 3, | |||
} | |||
FILES_STORE = '/mnt/data/' | |||
FILES_STORE = '/home/junior/projetos/scrapy/diario-oficial/data' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aqui tu tinha que manter o /mnt/data/
. 😅
|
||
def parse_pagelink(self,response): | ||
url = response.xpath('//p[contains(@class,"dom-chamadas")]/a/@href').extract_first() | ||
if url is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Você pode usar também if url:
(menos código é mais :)).
items.append( | ||
Gazette( | ||
date=self.start_date, | ||
file_urls=[self.mg_belohorizonte_url + file_url], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Descobri há pouco tempo que o Scrapy tem um método pra concatenar URL (o urljoin
). Seria algo tipo response.urljoin(file_url)
.
Blz, nos próximos ficarei atento. |
Comecei a fazer mg_uberlandia. Estou apanhando para conseguir pegar a data do diário. |
@juniorcarvalho eu tentei dar uma olhada na página mas parece que nesse momento site tá fora do ar. Seria bacana você abrir os spiders pra cada cidade em PRs diferentes, assim um não impede o outro de ser mergeado e também ajuda os mantenedores a ter uma boa visão do que cada PR tem. Amanhã vou tentar novamente - se você tiver notícias que o site voltou ou tiver uma página HTML de exemplo, é só falar. |
|
||
def parse_ano(self, response): | ||
url_meses = response.xpath('//a[contains(@target,"_blank") and contains(@href,"http://www.uberlandia.mg.gov.br")]') | ||
for url in url_meses: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dado que o código do repositório está em inglês, seria bacana manter esse padrão, mantendo todo o código em inglês também.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vacilei neste PR. Como corrigir este duplo PR ?
A pagina do diário de uberlandia: http://www.uberlandia.mg.gov.br/?pagina=Conteudo&id=39
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não tem problema, acontece! :) Você pode criar uma nova branch (tipo mg-uberlandia
) a partir da master, passar as alterações de Uberlândia pra lá e nessa branch aqui você pode:
- criar um commit deletando o código de Uberlândia
- fazer um rebase interativo para remover/dar squash no commit - isso faria com que o histórico ficasse limpo, sem o último commit de Uberlândia e o commit da deleção. Acho que esse passo aqui é opcional também.
Ainda não consigo carregar essa página. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deu timeout aqui. Tu tá conseguindo acessar normal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sim..normal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juniorcarvalho parece que não consigo acessar pq tô fora do BR (e não tenho VPN). 🙄 Rola me mandar a página inicial do diário (http://www.uberlandia.mg.gov.br) e essa página que tu mencionou? apgomes88 at gmail dot com
Que péssimo isso, @anapaulagomes – @anaschwendler e @cabral, vocês podem confirmar se isso é mesmo algo relacionado ao país do IP? De qualquer forma eu já perguntei (informalmente) no Twitter da prefeitura. Veremos. UPDATE a força do hábito me fez escrever em inglês sem perceber. Reescrevendo em pt-BR! |
De boas! Obrigada aí pela força. @anaschwendler me deu essa força e confirmou que o problema é esse mesmo. |
Closed in favor of #95 |
spider para Belo Horizonte-MG
Data inicial = 07/05/2016