Beautiful Soup是一个可以从HTML或XML文件提取数据的python库 能够通过你喜欢的转换器实现惯用的文档导航,查找,修改文档的方式 在爬虫中主要用到Beautiful Soup的查找提取功能 推荐使用Beautiful Soup4 安装Beautiful Soup4 一:ubuntu或Debain可以执行 apt-get-install Python-bs4 二:通过命令安装:easy_install beautifulsoup4或者pip install beautiful4 三:下载源码:https://pypi.python.org/pypi/beautifulsoup4/ 安装命令:python setup.py install Beautiful支持python标准库中的HTML解析器,还lxml。 lxml解析速度比HTML解析器速度快 安装lxml apt-get install Python-lxml easy_install lxml pip install lxml html5lib的解析方式与浏览器相同 安装html5lib apt-get install Python-html5lib easy_install html5lib pip install html5lib