一、未明确指定解析器,因此我正在为此系统使用最佳的HTML解析器(“ html.parser”)
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 60 of the file D:/TEST/LeanPython/testSelenium001.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.
bsobj = BeautifulSoup(driver.page_source)
问题代码
解决方法
在问题代码出加上 html.parser 解析
二 、安装bs4失败
DEPRECATION: bs4 is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
解决方法:
使用:
python -m pip install --upgrade setuptools