pip3 install lxml
如果使用国外的源下载速度慢,我们可以使用国内的源进行提速:
- 豆瓣源
pip3 install lxml -i https://pypi.douban.com/simple
- 清华大学源
pip3 install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple
如果不安装lxml
库,则在使用时会提示:
bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a parser library?