BeautifulSoup、lxml安装

1、BeautifulSoup:
(1)官网下载BeautifulSoup 后解压到 C:\Python27\bs4
(2)打开cmd,然后执行:
cd C:\Python27\bs4\beautifulsoup4-4.3.2 //回车
setup.py build //回车
setup.py install //回车
(3)安装完成
2、lxml解析器: Python版本的标准库中内置的HTML解析方法不够稳定。lxml作为第三方解析器,效率更高。
安装:
(1)查看系统情况:
这里写图片描述
第一行显示是cp35,cp35m,win_amd64,这里就是你的系统情况
(2) http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 下载你需要的版本
(3)将下载到的 lxml-3.6.4-cp35-cp35m-win_amd64.whl 放在C:\Python27\Scripts 下。
(4)安装pip(用于安装第三方模块):cd到C:\Python27\Scripts (easy_install.exe所在的地方),执行指令“asy_install.exe pip”。
(5)cd到C:\Python27\Scripts下安装wheel:
pip install wheel
(6)cd到C:\Python27\Scripts 下安装: pip install lxml-3.6.4-cp35-cp35m-win_amd64.whl
(7)测试:cmd下运行python,然后import lxml,如果不报错,安装成功!

猜你喜欢

转载自blog.csdn.net/misterfm/article/details/80417977