CA
Crawlee & Apify5mo ago
extended-salmon

Is there a way to get the number of enqueued links?

I have the following code for AdaptivePlaywrightCrawler and I want to log the number of enqueued links after calling enqueueLinks. router.addDefaultHandler(async ({ request, enqueueLinks, parseWithCheerio, querySelector, log, page }) => { await enqueueLinks({ strategy: 'same-domain', globs: globs, transformRequestFunction: (request) => { return request; }, }); });
2 Replies
Hall
Hall5mo ago
Someone will reply to you shortly. In the meantime, this might help:
robust-apricot
robust-apricot5mo ago
hey, you can get that from the object that is returned by the function: https://crawlee.dev/api/types/interface/BatchAddRequestsResult
BatchAddRequestsResult | API | Crawlee · Build reliable crawlers. F...
Crawlee helps you build and maintain your crawlers. It's open source, but built by developers who scrape millions of pages every day for a living.

Did you find this page helpful?