def parse(self,pageUrl,htmlCont):
if pageUrl is None or htmlCont is None:
return
soup = BeautifulSoup(htmlCont,'html_parser',from_encoding='utf-8')
new_urls = self._get_new_urls(pageUrl,soup)
new_data = self._get_new_data(pageUrl,soup)
return new_urls, new_data
这个方法里
soup = BeautifulSoup(htmlCont,'html_parser',from_encoding='utf-8')这一句代码执行完, parse 方法 就直接返回了,导致new_urls ,new_data 都没有值,main模块中的的try就出现异常,然后就退出了,是哪个环节出错导致的呀,求大神指点
添加回答
举报
0/150
提交
取消