Posted By

scrapy on 09/01/12


Tagged

import scrapy closespider


Versions (?)

Raising CloseSpider


 / Published in: Python
 

  1. # Required import statement for CloseSpider. Note: if intending to limit items, you can pass '--SET CLOSESPIDER_ITEMCOUNT=10' like so:
  2. #
  3. # scrapy crawl googledir --set CLOSESPIDER_ITEMCOUNT=10
  4.  
  5. from scrapy.exceptions import CloseSpider
  6.  
  7. raise CloseSpider('reason for closing')
  8.  
  9. # Snippet imported from snippets.scrapy.org (which no longer works)
  10. # author: redtricycle
  11. # date : Nov 21, 2011
  12.  

Report this snippet  

You need to login to post a comment.