我正在将遗留项目移植到django,并遇到了wierd数据库状态,这是一个已被HTML转义的文件内容: <strong>The &lsquo;Unbundling&rsquo; of Research is a secular, not cyclical, trend as it helps asset managers recognize and reward the value of research more independently</strong>.
我使用HTMLParser来解析一些基本的、格式良好的HTML,出于各种原因,我不想使用BeautifulSoup。我对HTMLParser进行了子类化,实际的解析器工作得很好。相反,当我创建一个新的子类对象时,直接调用HTMLParser的init方法,而子类init根本不被调用。当我继承HTMLParser.HTMLParser和urllib.HTMLParser时,就会发生这种情况。下面是代码:
class MyHtmlParser(htmllib.HTMLParser</