python使用 htmllib 分析网页内容,pythonhtmllib,import htmll


import htmllib, urllib, formatter, syswebsite = 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()

评论关闭