Created
January 23, 2019 17:38
-
-
Save barraponto/9d2540a0518d68e6c99d33b9316151a0 to your computer and use it in GitHub Desktop.
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 | |
def extrair_propriedade(propriedade): | |
dados = propriedade.css('::text').extract()[1:] | |
return [dado.strip() for dado in dados] | |
ficha = response.css('.ficha-tecnica li') | |
propriedades = [extrair_propriedade(propriedade) for propriedade in ficha] | |
item = { "url": response.url, "preco": 123 } | |
item.update(dict(propriedades)) | |
# yield item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment