python - Scrapy: skip item and continue with exectuion -


i'm doing rss spider. want continue execution of spider ignoring current node if there isn't match in current item... far i've got this:

        if info.startswith('foo'):             item['foo'] = info.split(':')[1]         else:             return none 

(info string that's sanitized xpath before...)

but i'm getting exception:

    exceptions.typeerror: cannot return "nonetype" object 

spider

so how can ignore node , continue execution?

parse(response):     #make manipulations     if info.startswith('foo'):             item['foo'] = info.split(':')[1]             return [item]         else:             return [] 

but better not use return, use yield or nothing

parse(response):     #make manipulations     if info.startswith('foo'):             item['foo'] = info.split(':')[1]             yield item         else:             return 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -