1. 程式人生 > >FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml.

FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml.

FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library

問題描述

在學習《PYTHON網路爬蟲從入門到實踐》一書時,用 jupyter notebook 執行書中程式碼時遇到如下報錯

FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install
a parser library

出錯原因

由於PYTHON3中沒有html解析器,即lxml

解決方法

sudo pip3 install lxml

安裝完重新啟動 jupyter notebook 即可