Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import urllib
from lxml import etree
import StringIO
url = ""
result = urllib.urlopen(url)
html =
parser = etree.HTMLParser()
tree = etree.parse(StringIO.StringIO(html), parser)
xpath = "//table[@id='ctl00_ContPlaceHolderMain_Alphabaticallist1_dg1']/tr[position()>1]/td[position()=2]/a/child::text()"
filtered_html = tree.xpath(xpath)
print filtered_html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment