1
WhiteLament 2015 年 7 月 27 日 'html.parser' 换成 'lxml' 试试?
|
2
lingo233 2015 年 7 月 27 日
我记得贴吧未登录只能看一页的内容。
|
3
iyaozhen 2015 年 7 月 27 日
2 楼应该是真相。
|
4
liaipeng OP @WhiteLament
提示这个,对BeautifulSoup模块还不熟悉,第一次接触 Couldn't find a tree builder with the features you requested: lxml.parser. Do you need to install a parser library? |
6
yappa 2015 年 7 月 27 日 html.parser改成lxml,或者html5lib,这两个模块都要先安装
|
9
WhiteLament 2015 年 7 月 27 日
你没安装
pip install lxml |
10
yappa 2015 年 7 月 27 日
估计你是从文档里面复制出来的代码,“html.parser”是“html解析器”的意思,你要找到适合的解析器,lxml,html5lib就是所谓的“html.parser"。
|
11
WhiteLament 2015 年 7 月 27 日
有些页面不够规范,不同解析器兼容不一样,造成结果不同。
我也遇到过,换一个解析器就好了 |
12
liaipeng OP |