0
我已經安裝了html5lib軟件包。我敢肯定,因爲當我嘗試安裝它時,我收到一條消息,指出它已安裝。html5lib已安裝,但BeautifulSoup無法找到它
pip install html5lib
Requirement already satisfied: html5lib in ./anaconda/lib/python3.5/site-packages
此外,我能夠成功導入該軟件包。
import html5lib
然而,當我嘗試使用分析器作爲BeautifulSoup構造的一部分
soup = BeautifulSoup(response.data, 'html5lib')
我不成功
FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?
是否有可能迫使BS4查找已安裝的解析器併成功找到html5lib?
我想要的是''html.parser''而不是''html5lib''。如果不是,並且您正在使用像pycharm這樣的智能ide,請重新啓動它。 – MegaIng
html5lib是我正在尋找的。它與html.parser不同。看到列表https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser –
正確的python版本? – MegaIng