[Tutor] html links

Thorsten Kampe thorsten at thorstenkampe.de
Fri May 25 16:05:36 CEST 2007


* max . (Mon, 14 May 2007 20:27:15 -0600)
> does anyone know of a tutorial for finding links in a web site with python.

import formatter, \
       htmllib,   \
       urllib

url = 'http://python.org'

htmlp = htmllib.HTMLParser(formatter.NullFormatter())
htmlp.feed(urllib.urlopen(url).read())
htmlp.close()

print htmlp.anchorlist



More information about the Tutor mailing list