按装bs4

安装bs4 也要安装
pip install lxml

cannot import name ‘HTMLParseError’ from ‘html.parser’
如果安装bs4之后报上面的错误,解决方法如下:

进到Python安装目录\Python\Python35-32\Lib\site-packages\bs4\builder目录下,找到_htmlparser.py,用idle打开,注释掉HTMLParseError这行就行了,如图按装bs4

参考链接
作者:John Lee
链接:https://www.zhihu.com/question/37949586/answer/86844606
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。