import urllib, htmllib, formatter
website = urllib.urlopen("http://w3mentor.com")
data = website.read()
website.close()
format = formatter.AbstractFormatter(formatter.NullWriter())
ptext = htmllib.HTMLParser(format)
ptext.feed(data)
for link in ptext.anchorlist:
print(link)
#//python/7383