pydev debugger: starting (pid: 7212)craw 1,http://baike.baidu.com/item/PythonTraceback (most recent call last): File "D:\eclipse-standard_downza\eclipse\plugins\org.python.pydev_3.9.0.201411111611\pysrc\pydevd.py", line 2183, in <module> globals = debugger.run(setup['file'], None, None) File "D:\eclipse-standard_downza\eclipse\plugins\org.python.pydev_3.9.0.201411111611\pysrc\pydevd.py", line 1622, in run pydev_imports.execfile(file, globals, locals) # execute the script File "D:\workspase\imooc\baike_spider\spider_main.py", line 41, in <module> obj_spider.craw(root_url) File "D:\workspase\imooc\baike_spider\spider_main.py", line 25, in craw new_urls,new_data=self.parser.parse(new_url,html_cont) File "D:\workspase\imooc\baike_spider\html_parser.py", line 35, in parse soup = BeautifulSoup(html_cont,'html_parser',from_encoding='utf-8') File "C:\Python27\lib\site-packages\bs4\__init__.py", line 165, in __init__ % ",".join(features))bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html_parser. Do you need to install a parser library?
1 回答
习惯受伤
TA贡献885条经验 获得超1144个赞
soup = BeautifulSoup(html_cont,'html_parser',from_encoding='utf-8')
这句你改成:
soup = BeautifulSoup(html_cont,'html.parser',from_encoding='utf-8')
添加回答
举报
0/150
提交
取消