-
How can I programmatically stop the crawler when a condition is met? I want to extract N products from an ecommerce website, which usually requires more than N requests because not all links point to a product page. I know of 2 ways:
I'm looking for something like if (productsCrawled >= maxProductsPerCrawl) {
crawler.stop();
}; Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Related discussion https://discord.com/channels/801163717915574323/1138931745442500698/1138931745442500698 |
Beta Was this translation helpful? Give feedback.
-
There is |
Beta Was this translation helpful? Give feedback.
There is
crawler.teardown()
, it will stop the autoscaled pool and clean up some event handlers (plus trigger persist state event).