- Debian/Ubuntu,install
$ apt-get install python-bs4
- easy_install/pip
$ easy_install beautifulsoup4 $ pip install beautifulsoup4
- 安装第三方分析器
bs4只有py2的代码,安装在py3下会很麻烦
bs4支持HTML parser,也可以支持第三方的分析器
- lxml
$ apt-get install python-lxml
$ easy_install lxml
$ pip install lxml
- html5lib
$ apt-get install python-html5lib
$ easy_install html5lib
$ pip install html5lib