时间:2021-07-01 10:21:17 帮助过:53人阅读
import urllib, htmllib, formatter website = urllib.urlopen("http://yourweb.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程序设计有所帮助。