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.

Build docs

Ondra Urbana9e42f3ed723
diff --git a/docs/api/Request.md b/docs/api/Request.md
index 52a0c0647..c0038c977 100644
--- a/docs/api/Request.md
+++ b/docs/api/Request.md
@@ -101,7 +101,7 @@ const foo = request.userData.foo;
* [Request](request)
* [`new Request(options)`](#new_Request_new)
- * [`.pushErrorMessage(errorOrMessage)`](#Request+pushErrorMessage)
+ * [`.pushErrorMessage(errorOrMessage, [options])`](#Request+pushErrorMessage)
<a name="new_Request_new"></a>
@@ -181,7 +181,7 @@ to override the default behavior and specify which URLs shall be considered equa
</table>
<a name="Request+pushErrorMessage"></a>
-## `request.pushErrorMessage(errorOrMessage)`
+## `request.pushErrorMessage(errorOrMessage, [options])`
Stores information about an error that occurred during processing of this request.
You should always use Error instances when throwing errors in JavaScript.
@@ -194,14 +194,23 @@ as possible, since just throwing a bad type error makes any debugging rather dif
<table>
<thead>
<tr>
-<th>Param</th><th>Type</th>
+<th>Param</th><th>Type</th><th>Default</th>
</tr>
</thead>
<tbody>
<tr>
-<td><code>errorOrMessage</code></td><td><code>Error</code> | <code>String</code></td>
+<td><code>errorOrMessage</code></td><td><code>Error</code> | <code>String</code></td><td></td>
</tr>
<tr>
<td colspan="3"><p>Error object or error message to be stored in the request.</p>
+</td></tr><tr>
+<td><code>[options]</code></td><td><code>Object</code></td><td></td>
+</tr>
+<tr>
+<td colspan="3"></td></tr><tr>
+<td><code>[options.omitStack]</code></td><td><code>Boolean</code></td><td><code>false</code></td>
+</tr>
+<tr>
+<td colspan="3"><p>Only push the error message without stack trace when true.</p>
</td></tr></tbody>
</table>
diff --git a/docs/examples/PuppeteerCrawler.md b/docs/examples/PuppeteerCrawler.md
index ee8b8ec40..db5f184bb 100644
--- a/docs/examples/PuppeteerCrawler.md
+++ b/docs/examples/PuppeteerCrawler.md
@@ -17,7 +17,7 @@ Apify.main(async () => {
// Create and initialize an instance of the RequestList class that contains the start URL.
const requestList = new Apify.RequestList({
sources: [
- { url: 'http://www.ycombinator.com/' },
+ { url: 'https://news.ycombinator.com/' },
],
});
await requestList.initialize();
@@ -33,9 +33,12 @@ Apify.main(async () => {
requestList,
requestQueue,
- // Run Puppeteer in headless mode. If you set headless to false, you'll see the scraping
- // browsers showing up on your screen. This is great for debugging.
- launchPuppeteerOptions: { headless: true },
+ // Here you can set options that are passed to the Apify.launchPuppeteer() function.
+ // For example, you can set "slowMo" to slow down Puppeteer operations to simplify debugging
+ launchPuppeteerOptions: { slowMo: 500 },
+
+ // Stop crawling after several pages
+ maxRequestsPerCrawl: 10,
// This function will be called for each URL to crawl.
// Here you can write the Puppeteer scripts you are familiar with,