python使用 htmllib 分析网页内容
import htmllib, urllib, formatter, sys
website = urllib.urlopen("http://w3mentor.com")
data = website.read()
website.close()
format = formatter.AbstractFormatter(formatter.DumbWriter(sys.stdout))
ptext = htmllib.HTMLParser(format)
ptext.feed(data)
ptext.close()
