Skip to content

Instantly share code, notes, and snippets.

@bngsudheer
Created August 22, 2010 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bngsudheer/544125 to your computer and use it in GitHub Desktop.
Save bngsudheer/544125 to your computer and use it in GitHub Desktop.
#!usr/bin/python
import urllib
from lxml import etree
import StringIO
url = "http://164.100.47.132/LssNew/Members/Alphabaticallist.aspx"
result = urllib.urlopen(url)
html = result.read()
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