Apify

Apify and Crawlee Official Forum

b
F
A
J
A

EnqueueLInks

It is possible to add delay's in enqueueLinks? like before to crawl a certain URL I want to add some delay.
L
P
B
5 comments
You can delay any request in the preNavigationHooks. Just keep in mind that Crawler is scaling concurrency based on the CPU utilization so it will not influence maxConcurrency
Hi There is basic example to the Lukas's suggestion:
Plain Text
import { utils } from 'crawlee';

// ...

new PlaywrightCrawler({
  // ....
  preNavigationHooks: [
    async (context) => {
        await utils.sleep(10_000);
    },
  ],
  // ...
});
hmm does cheerioocrawler has a preNavigationHooks?
Oh I didn't see this. Thanks for this I thought preNavigationHooks option is only for PlaywrightCrawler. Again Thank you !
Add a reply
Sign up and join the conversation on Discord
Join