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?