Skip to content

Instantly share code, notes, and snippets.

@jmg
Created January 6, 2012 19:30
Show Gist options
  • Save jmg/1572023 to your computer and use it in GitHub Desktop.
Save jmg/1572023 to your computer and use it in GitHub Desktop.
Another_scraper.py
from lxml import etree
from StringIO import StringIO
import urllib2
url = "http://www.ivao.aero/flightss/list.asp"
data = urllib2.urlopen(url).read()
parser = etree.HTMLParser()
tree = etree.parse(StringIO(data), parser)
table = tree.xpath("/html/body/div/div/center/table")[0]
for tr in table[2:]:
print [td[0].text for td in tr]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment