操作系统:MacOs
报错信息:
**
bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml.
**
程序代码:
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("https://www.xx.com.cn/")
bsObj = BeautifulSoup(html, "lxml")
divList = bsObj.findAll("div")
for div in divList:
print(div)
需要安装lxml模块
pip3 install lxml