Files
apify--crawlee/docs/examples/crawl_all_links_playwright.ts
2026-07-13 13:23:39 +08:00

14 lines
461 B
TypeScript

import { PlaywrightCrawler } from 'crawlee';
const crawler = new PlaywrightCrawler({
async requestHandler({ request, enqueueLinks, log }) {
log.info(request.url);
// Add all links from page to RequestQueue
await enqueueLinks();
},
maxRequestsPerCrawl: 10, // Limitation for only 10 requests (do not use if you want to crawl all links)
});
// Run the crawler with initial request
await crawler.run(['https://crawlee.dev']);