js-crawler icon indicating copy to clipboard operation
js-crawler copied to clipboard

stop crawling

Open Muneem opened this issue 8 years ago • 5 comments

Is it possible to force crawler to stop its crawling. I have condition that only 500 pages should be crawled when that condition is met ti want to stop this crawler

Muneem avatar Feb 20 '17 00:02 Muneem

This is not possible at the moment, but should be quite easy to implement. I will try to add this feature in the near future.

amoilanen avatar Feb 20 '17 20:02 amoilanen

yes this feature is very good and it should be added

Muneem avatar Feb 21 '17 00:02 Muneem

Any news on this?

Cool-Programmer avatar Jun 13 '19 18:06 Cool-Programmer

Has been couple years so... bump. Must have!

thank you

fnmendez avatar Jul 21 '21 05:07 fnmendez

I found a workaround to stop the crawler.

Once your condition to stop is met, just set the shouldCrawl function to return false always.

crawler.shouldCrawl = () => false;

fnmendez avatar Jul 22 '21 19:07 fnmendez