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.

Merge develop

Ondra Urbanc3f250a28974
diff --cc docs/api/CheerioCrawler.md
index 5fe53b748,a03aaec3a..c79d6b67d
--- a/docs/api/CheerioCrawler.md
+++ b/docs/api/CheerioCrawler.md
@@@ -116,8 -117,14 +116,8 @@@ await crawler.run()
</tr>
<tr>
<td colspan="3"><p>Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites.
- Either <a href="requestlist"><code>RequestList</code></a> or <a href="requestqueue"><code>RequestQueue</code></a> must be provided.</p>
+ Either <code>requestList</code> or <code>requestQueue</code> option must be provided (or both).</p>
</td></tr><tr>
-<td><code>[options.requestFunction]</code></td><td><code>function</code></td><td></td>
-</tr>
-<tr>
-<td colspan="3"><p>Overrides the default function that performs the HTTP request to get the raw HTML needed for Cheerio.
- See source code on <a href="https://github.com/apifytech/apify-js/blob/master/src/cheerio_crawler.js#L264">GitHub</a> for default behavior.</p>
-</td></tr><tr>
<td><code>[options.requestOptions]</code></td><td><code>Object</code></td><td></td>
</tr>
<tr>
diff --cc src/cheerio_crawler.js
index 231b1bd52,9ba17395e..97c50d6cd
--- a/src/cheerio_crawler.js
+++ b/src/cheerio_crawler.js
@@@ -105,22 -104,18 +105,22 @@@ const DEFAULT_OPTIONS =
* If the function returns a promise, it is awaited.
* @param {RequestList} options.requestList
* Static list of URLs to be processed.
- * Either {@link RequestList} or {@link RequestQueue} must be provided.
+ * Either `requestList` or `requestQueue` option must be provided (or both).
* @param {RequestQueue} options.requestQueue
* Dynamic queue of URLs to be processed. This is useful for recursive crawling of websites.
- * Either {@link RequestList} or {@link RequestQueue} must be provided.
+ * Either `requestList` or `requestQueue` option must be provided (or both).
- * @param {Function} [options.requestFunction]
- * Overrides the default function that performs the HTTP request to get the raw HTML needed for Cheerio.
- * See source code on <a href="https://github.com/apifytech/apify-js/blob/master/src/cheerio_crawler.js#L264">GitHub</a> for default behavior.
* @param {Object} [options.requestOptions]
- * Represents the options passed to the `requestFunction`, which are essentially the options passed to
- * <a href="https://www.npmjs.com/package/request-promise" target="_blank">request-promise</a> to make the HTTP call.
- * Provided `requestOptions` are merged with defaults so if you only need to add a parameter, there's no need to duplicate
- * the whole object.
+ * Represents the options passed to
+ * <a href="https://www.npmjs.com/package/request" target="_blank">request</a> to make the HTTP call.
+ * Provided `requestOptions` are added to internal defaults that cannot be overridden to ensure
+ * the operation of `CheerioCrawler` and all its options. If you need more granular control over
+ * your requests, use {@link BasicCrawler}.
+ *
+ * The internal defaults include:
+ * - `url`, `method`, `headers`: provided by `requestList` and/or `requestQueue`
+ * - `strictSSL`: use `options.ignoreSslErrors`
+ * - `proxy`: use `options.useApifyProxy` or `options.proxyUrls`
+ *
* @param {Number} [options.handlePageTimeoutSecs=300]
* Timeout in which the function passed as `options.handlePageFunction` needs to finish, given in seconds.
* @param {Number} [options.requestTimeoutSecs=30]