Created
March 2, 2011 12:22
-
-
Save henriquegogo/850849 to your computer and use it in GitHub Desktop.
Parser em Python usando o pyquery
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
from pyquery import PyQuery | |
import urllib | |
#peixe = PyQuery(urllib.urlopen('http://www.peixeurbano.com.br').read()) | |
click = PyQuery(urllib.urlopen('http://www.clickon.com.br/clickon-client-http-deal/Fortaleza').read()) | |
chuchu = PyQuery(urllib.urlopen('http://www.baratoprachuchu.com.br/').read()) | |
coletivo = PyQuery(urllib.urlopen('http://www.baratocoletivo.com.br/').read()) | |
#print 'Oferta do Peixe Urbano: ' + peixe('html').html() | |
print 'Oferta do ClickOn: ' + click('.offer a').html().strip() + ' Valor: ' + click('.price h2').html().strip() | |
print 'Oferta do Barato pra Chuchu: ' + chuchu('.tituloBanner h3').html().strip() + ' Valor: R$' + chuchu('.comparacaoPrecos td:last').html().strip() | |
print 'Oferta do Barato Coletivo: ' + coletivo('#deal-intro h1').html().strip() + ' Valor: ' + coletivo('#precocima p strong').html().strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment