Skip to content

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.

Avoid uncaught promise rejection

Ondra Urbandcabece903a2
diff --git a/src/puppeteer_pool.js b/src/puppeteer_pool.js
index 9934f0027..32e8f7152 100644
--- a/src/puppeteer_pool.js
+++ b/src/puppeteer_pool.js
@@ -326,8 +326,8 @@ class PuppeteerPool {
return;
}
- const browser = await instance.browserPromise;
try {
+ const browser = await instance.browserPromise;
const pages = await browser.pages();
// NOTE: we are killing instance when the number of pages is less or equal to 1 because there is always about:blank page.
if (pages.length <= 1) {