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

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -