

Using the functionality provided by the AutoscaledPool class.Īll AutoscaledPool configuration options can be passed to the toscaledPoolOptions

New pages are only opened when there is enough free CPU and memory available,

tab) for each Request object to crawlĪnd then calls the function provided by user as the PuppeteerCrawlerOptions.requestHandler option. PuppeteerCrawler opens a new Chrome page (i.e. The crawler finishes when there are no more Request objects to crawl. This ensures that a single URL is not crawled multiple times. To RequestQueue before it starts their processing. The instance first processes URLs from the RequestList and automatically enqueues all of them If both PuppeteerCrawlerOptions.requestList and PuppeteerCrawlerOptions.requestQueue are used, The source URLs are represented using Request objects that are fed from RequestList or RequestQueue instances provided by the PuppeteerCrawlerOptions.requestList or PuppeteerCrawlerOptions.requestQueue constructor options, respectively. If the target website doesn't need JavaScript, consider using CheerioCrawler, which downloads the pages using raw HTTP requests and is about 10x faster. Since PuppeteerCrawler uses headless Chrome to download web pages and extract data, it is useful for crawling of websites that require to execute JavaScript. The URLs to crawl are fed either from a static list of URLs or from a dynamic queue of URLs enabling recursive crawling of websites. A simple framework for parallel crawling of web pages using headless Chrome with Puppeteer.
