python3 NoneType object is not callable怎么解決
我的是python3運行不出來,為什么呢?錯誤代碼如下:
craw 1 : https://baike.baidu.com/item/Python
Traceback (most recent call last):
? File "F:\workplace\imooc\baike_spider\spider_main.py", line 43, in craw
? ? new_urls,new_data = self.parser.parse(new_url, html_cont)
? File "F:\workplace\imooc\baike_spider\html_parser.py", line 65, in parse
? ? new_data = self._get_new_data(page_url, soup)
? File "F:\workplace\imooc\baike_spider\html_parser.py", line 43, in _get_new_data
? ? res_data['title'] = title_node.get_next()
TypeError: 'NoneType' object is not callable
2018-09-28
后面不用追加 () 就行了
2017-10-25
你好,請問你解決了嘛?
2017-10-12
C:\Python27\python.exe E:/Helloworld/baike_spider/spider_main.py
craw 1 : https://baike.baidu.com/item/Python
Traceback (most recent call last):
? File "E:/Helloworld/baike_spider/spider_main.py", line 33, in <module>
? ? obj_spider.craw(root_url)
? File "E:/Helloworld/baike_spider/spider_main.py", line 19, in craw
? ? new_urls, new_data = self.parser.parse(new_url, html_cont)
TypeError: 'NoneType' object is not iterable
2017-10-02
你好,我也遇到這個問題了,請問你是怎么解決的?
2017-09-24
單看錯誤是說 None類型并不是一個可調用(callable)類型。
所謂callable對象是指一個后邊可以加()的對象,比如函數。Python中一切皆對象。