bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml.
soup = BeautifulSoup(r.text, "lxml")
出现以下错误:
bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a parser library?
原因:没有解析库安装包
方法一:将参数lxml修改为html.parser
soup=BeautifulSoup(content,'html.parser')
方法二:
先cmd中pip3 install lxml
然后pycharm设置:setting- project filename-project interpreter-add(+)-刷新