import urllib

res = []
html = urllib.urlopen('http://www.cia.gov/cia/publications/factbook/fields/2002.html').read()
for tag in html.split('class="CountryLink">')[1:]:
    country, tag = tag.split('</a',1)
    growth = tag.split('class="Normal">',1)[1].split('%')[0].strip()
    if growth[0]=='N': growth = None
    else: growth=float(growth)
    res.append( [country,growth] )
print "countryList = %s" % `res`

