import httplib2, lxml, pyquery h = httplib2.Http(".cache") def get(url): resp, content = h.request( url, headers={'cache-control':'max-age=3600'}) return pyquery.PyQuery( lxml.etree.HTML(content) )
pq = get("http://foo.com/bar") checkboxes = pq('form input[type=checkbox]') nextpage = pq('a.next').attr('href')
Just something else to throw in the toolbelt ...
https://github.com/kennethreitz/requests
import requests from lxml import etree jquery_like_page = etree.HTML(requests.get('url').text)
Keep meaning to check out more of the Pycon vids
[1]: http://anemone.rubyforge.org/doc/index.html
Unfortunately, the page is literally broken and unreadable on Android ICS with Chrome :(
This is a known issue and I'm working on it! I'll try to push a "responsive" version today or tomorrow.
Just something else to throw in the toolbelt ...