In Scrapy 0.14, raising CloseSpider exception should shutdown the
spider.I am trying to raise CloseSpider from my items pipeline. It
works fine when the exception is thrown from the init method but does
not work when raised from the spider_opened method. Why is that?
Many thanks.
Radu
Raising it from a pipeline's __init__ method does not make
sense as the pipelines are instantiated before any spider is opened.
To close an spider for any part of your code you should use
`engine.close_spider`
method. See this extension for an usage example:
https://github.com/scrapy/scrapy/blob/master/scrapy/contrib/closespider.py#L61
~Rolando
> --
> You received this message because you are subscribed to the Google Groups "scrapy-users" group.
> To post to this group, send email to scrapy...@googlegroups.com.
> To unsubscribe from this group, send email to scrapy-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/scrapy-users?hl=en.
>
>