Skip to content

Instantly share code, notes, and snippets.

@henriquegogo
Created March 2, 2011 12:22
Show Gist options
  • Save henriquegogo/850849 to your computer and use it in GitHub Desktop.
Save henriquegogo/850849 to your computer and use it in GitHub Desktop.
Parser em Python usando o pyquery
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