Skip to content

Instantly share code, notes, and snippets.

@cesarkawakami
Created January 3, 2013 02:59
Show Gist options
  • Save cesarkawakami/4440361 to your computer and use it in GitHub Desktop.
Save cesarkawakami/4440361 to your computer and use it in GitHub Desktop.
import urllib2
import html5lib
import cssselect
url = "http://ahr13.mapyourshow.com/5_0/exhibitor_results.cfm?alpha=%40&type=alpha&page=1"
html = urllib2.urlopen(url).read()
root = html5lib.parse(html, treebuilder="lxml", namespaceHTMLElements=False)
xpath = cssselect.HTMLTranslator().css_to_xpath(".mys-elastic.mys-left a")
for element in root.xpath(xpath):
print element.get("href")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment