SGMLParser是python2.x版本自带的模块,python3.x后都集成在模块htmlParser中,不过使用方法大同小异 因此可以使用 from html.parser import HTMLParser 来代替SGMLParser