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.

Checked options parameter in blockRequests util function

drobnikj7ddaf33e8ac1
diff --git a/src/puppeteer_utils.js b/src/puppeteer_utils.js
index 80932dc1a..2ab525aea 100644
--- a/src/puppeteer_utils.js
+++ b/src/puppeteer_utils.js
@@ -238,12 +238,14 @@ const enqueueRequestsFromClickableElements = async (page, selector, purls, reque
* @memberOf puppeteer
*/
const blockRequests = async (page, options = {}) => {
+ checkParamOrThrow(page, 'page', 'Object');
+ checkParamOrThrow(options, 'options', 'Object');
+
const {
urlPatterns = [],
includeDefaults = true,
} = options;
- checkParamOrThrow(page, 'page', 'Object');
checkParamOrThrow(urlPatterns, 'options.urlPatterns', '[String]');
checkParamOrThrow(includeDefaults, 'options.includeDefaults', 'Boolean');