运行python的爬虫时,报错:'NoneType' object has no attribute 'get_text'
我在eclipse中,运行python的爬虫时,报错:'NoneType' object has no attribute 'get_text',怎么办???
我在eclipse中,运行python的爬虫时,报错:'NoneType' object has no attribute 'get_text',怎么办???
2016-10-18
#<dd class="lemmaWgt-lemmaTitle-title"><h1>****</h1></dd>
title_node=soup.find('dd',class_="lemmaWgt-lemmaTitle-title".find("h1"))
if title_node is None:
return
res_data['title']=title_node.get_text()
#<div class="lemma-summary" label-module="lemmaSummary">
summary_node=soup.find('div',class_="lemma-summary")
if summary_node is None:
return
res_data['summary'] = summary_node.get_text()
举报