python - Scrapy Limit Requests For Testing -
i've been searching scrapy documentation way limit number of requests spiders allowed make. during development don't want sit here , wait spiders finish entire crawl, though crawls pretty focused can still take quite awhile.
i want ability say, "after x requests site i'm scraping stop generating new requests."
i wondering if there setting may have missed or other way using framework before try come own solution.
i considering implementing downloader middleware keep track of number of requests being processed , stop passing them downloader once limit has been reached. said i'd rather use mechanism in framework if possible.
any thoughts? thank you.
you looking closespider_pagecount
setting of closespider
extension:
an integer specifies maximum number of responses crawl. if spider crawls more that, spider closed reason
closespider_pagecount
. if 0 (or non set), spiders won’t closed number of crawled responses.
Comments
Post a Comment