# population.py, by chaynes@indiana.edu import http population_url = 'http://www.census.gov/main/www/popclock.html' def main(): text = http.get(population_url) start_text = 'id="wclocknum">' start = text.index(start_text) + len(start_text) stop = text.index('<', start) print text[start : stop] main()