Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Improvements in logging in PuppeteerPool, updated comments
Jan Curnd8b289e26135
diff --git a/src/puppeteer_pool.js b/src/puppeteer_pool.jsindex 3bb7ba10a..bbe51eb0e 100644--- a/src/puppeteer_pool.js+++ b/src/puppeteer_pool.js@@ -162,14 +162,14 @@ export default class PuppeteerPool {}/**- * Retires some of the instances for example due to to many uses.+ * Retires some of the instances for example due to many uses.** @ignore*/_retireInstance(instance) {const { id } = instance;- if (!this.activeInstances[id]) return log.warning('PuppeteerPool: browser is retired already', { id });+ if (!this.activeInstances[id]) return log.debug('PuppeteerPool: browser is retired already', { id });log.debug('PuppeteerPool: retiring browser', { id });@@ -236,7 +236,7 @@ export default class PuppeteerPool {}/**- * Opens new tab in one of the browsers and returns promise that resolves to it's Puppeteer.Page.+ * Opens new tab in one of the browsers and returns promise that resolves to its Puppeteer.Page.** @return {Promise<Puppeteer.Page>}*/@@ -262,6 +262,7 @@ export default class PuppeteerPool {.then((page) => {page.on('error', (error) => {log.exception(error, 'PuppeteerPool: page crashed');+ // Ignore errors from Page.close()page.close();});