python3.6用HTMLParser解析html时报错 No module named 'htmlentitydefs'或No module named 'markupbase' 先上代码 from HTMLParser import HTMLParser import urllib.request class myhtml(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.flag = 0 self.links…
from html.parser import HTMLParser from html.entities import name2codepoint class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): for (variable, value) in attrs: print(variable, value) if variable == 'class' and value == 'item': prin…