【发布时间】:2011-02-18 10:23:09
【问题描述】:
我正在做一个 RSS 蜘蛛。我想继续执行 如果当前节点没有匹配,蜘蛛会忽略当前节点 项目...到目前为止,我得到了这个:
if info.startswith('Foo'):
item['foo'] = info.split(':')[1]
else:
return None
(info 是一个在...之前从 xpath 清理过的字符串)
但我遇到了这个异常:
exceptions.TypeError: You cannot return an "NoneType" object from a
蜘蛛
那么我怎样才能忽略这个节点并继续执行呢?
【问题讨论】:
标签: python web-crawler scrapy