template = 'http://pleac.sourceforge.net/pleac_perl/%s.html' chapters = '''strings numbers datesandtimes arrays hashes patternmatching fileaccess filecontents directories subroutines referencesandrecords packagesetc classesetc dbaccess userinterfaces processmanagementetc sockets internetservices cgiprogramming webautomation'''.split() import urllib, re for chapter in chapters: html = urllib.urlopen(template % chapter).read() print re.search(r'AEN(\d+)', html).group(1), # 14 73 132 170 232 285 359 430 495 536 # 592 642 704 754 792 851 919 978 1007 1054