当没安装lxml的时候,终端中运行python文件会报错:
Traceback (most recent call last):
File "web_parse.py", line 4, in <module>
Soup = BeautifulSoup(wb_data,'lxml')
File "/Library/Python/2.7/site-packages/bs4/__init__.py", line 152, in __init__
% ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
打开终端
cd到相关的文件夹,
sudo easy_install lxml
Searching for lxml
Best match: lxml 3.8.0