課程
/后端開發(fā)
/Python
/Python開發(fā)簡單爬蟲
用的是python3,求助
2017-10-02
源自:Python開發(fā)簡單爬蟲 7-5
正在回答
craw 1 : https://baike.baidu.com/item/%E5%90%B4%E4%BA%A6%E5%87%A1/8325774?fr=aladdinTraceback (most recent call last):? File "D:\Documents\Downloads\eclipse\eclipse練習\1\kris\spider_main.py", line 53, in <module>??? obj_spider.craw(root_url)? File "D:\Documents\Downloads\eclipse\eclipse練習\1\kris\spider_main.py", line 28, in craw??? new_urls, new_data = self.parser.parse(new_url, html_cont)TypeError: 'NoneType' object is not iterable
請問各位大神? 這個問題什么意思
同樣遇到你這個問題,重新看了一遍老師的視頻,發(fā)現(xiàn)是自己寫錯了,把soup = BeautifulSoup(html_cont, 'html_parser', from_encoding='utf-8')改為soup = BeautifulSoup(html_cont, 'html.parser', from_encoding='utf-8')就可以啦
crawl 1 : https://baike.baidu.com/item/Python/407313?fr=aladdin
Traceback (most recent call last):
? File "D:\Eclipse\project\crawl\school\spider_main.py", line 39, in <module>
? ? obj_spider.craw(root_url)
? File "D:\Eclipse\project\crawl\school\spider_main.py", line 23, in craw
? ? new_urls, new_data = self.parser.parse(new_url, html_cont)
? File "D:\Eclipse\project\crawl\school\html_parser.py", line 41, in parse
? ? soup = BeautifulSoup(html_cont, 'html_parser', from_encoding='utf-8')
? File "build\bdist.win-amd64\egg\bs4\__init__.py", line 165, in __init__
? ??
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html_parser. Do you need to install a parser library?
什么原因
先不要寫在try塊里面,這樣可以看到哪錯了
weixin_慕慕4455050
舉報
本教程帶您解開python爬蟲這門神奇技術的面紗
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-04-09
craw 1 : https://baike.baidu.com/item/%E5%90%B4%E4%BA%A6%E5%87%A1/8325774?fr=aladdin
Traceback (most recent call last):
? File "D:\Documents\Downloads\eclipse\eclipse練習\1\kris\spider_main.py", line 53, in <module>
??? obj_spider.craw(root_url)
? File "D:\Documents\Downloads\eclipse\eclipse練習\1\kris\spider_main.py", line 28, in craw
??? new_urls, new_data = self.parser.parse(new_url, html_cont)
TypeError: 'NoneType' object is not iterable
請問各位大神? 這個問題什么意思
2018-01-15
同樣遇到你這個問題,重新看了一遍老師的視頻,發(fā)現(xiàn)是自己寫錯了,把soup = BeautifulSoup(html_cont, 'html_parser', from_encoding='utf-8')改為soup = BeautifulSoup(html_cont, 'html.parser', from_encoding='utf-8')就可以啦
2017-10-24
crawl 1 : https://baike.baidu.com/item/Python/407313?fr=aladdin
Traceback (most recent call last):
? File "D:\Eclipse\project\crawl\school\spider_main.py", line 39, in <module>
? ? obj_spider.craw(root_url)
? File "D:\Eclipse\project\crawl\school\spider_main.py", line 23, in craw
? ? new_urls, new_data = self.parser.parse(new_url, html_cont)
? File "D:\Eclipse\project\crawl\school\html_parser.py", line 41, in parse
? ? soup = BeautifulSoup(html_cont, 'html_parser', from_encoding='utf-8')
? File "build\bdist.win-amd64\egg\bs4\__init__.py", line 165, in __init__
? ??
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html_parser. Do you need to install a parser library?
什么原因
2017-10-02
先不要寫在try塊里面,這樣可以看到哪錯了