1、报错内容:
GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 11 of the file F:/爬虫/test01.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.
bsObj = BeautifulSoup(content.read())
原因:beautiful soup运行时没有指定的解释器
解决:
bsObj = BeautifulSoup(content.read(), 'html5lib')
html5lib 安装方式:pip install html5lib