/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# Required import statement for CloseSpider. Note: if intending to limit items, you can pass '--SET CLOSESPIDER_ITEMCOUNT=10' like so: # # scrapy crawl googledir --set CLOSESPIDER_ITEMCOUNT=10 from scrapy.exceptions import CloseSpider raise CloseSpider('reason for closing') # Snippet imported from snippets.scrapy.org (which no longer works) # author: redtricycle # date : Nov 21, 2011