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
Build docs
Ondra Urban70b42c0f043e
diff --git a/docs/api/AutoscaledPool.md b/docs/api/AutoscaledPool.mdindex e4f771bf1..0e95ac5e6 100644--- a/docs/api/AutoscaledPool.md+++ b/docs/api/AutoscaledPool.md@@ -53,8 +53,13 @@ await pool.run();* [AutoscaledPool](autoscaledpool)* [`new AutoscaledPool(options)`](#new_AutoscaledPool_new)- * [`.setMaxConcurrency(maxConcurrency)`](#AutoscaledPool+setMaxConcurrency)- * [`.setMinConcurrency(minConcurrency)`](#AutoscaledPool+setMinConcurrency)+ * [`.minConcurrency`](#AutoscaledPool+minConcurrency)+ * [`.minConcurrency`](#AutoscaledPool+minConcurrency)+ * [`.maxConcurrency`](#AutoscaledPool+maxConcurrency)+ * [`.maxConcurrency`](#AutoscaledPool+maxConcurrency)+ * [`.desiredConcurrency`](#AutoscaledPool+desiredConcurrency)+ * [`.desiredConcurrency`](#AutoscaledPool+desiredConcurrency)+ * [`.currentConcurrency`](#AutoscaledPool+currentConcurrency)* [`.run()`](#AutoscaledPool+run) ⇒ <code>Promise</code>* [`.abort()`](#AutoscaledPool+abort) ⇒ <code>Promise</code>* [`.pause([timeoutSecs])`](#AutoscaledPool+pause) ⇒ <code>Promise</code>@@ -103,14 +108,14 @@ await pool.run();<td><code>[options.minConcurrency]</code></td><td><code>Number</code></td><td><code>1</code></td></tr><tr>-<td colspan="3"><p>Minimum number of tasks running in parallel.</p>+<td colspan="3"><p>The minimum number of tasks running in parallel.</p><p> <em>WARNING:</em> If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash.If you're not sure, just keep the default value and the concurrency will scale up automatically.</p></td></tr><tr><td><code>[options.maxConcurrency]</code></td><td><code>Number</code></td><td><code>1000</code></td></tr><tr>-<td colspan="3"><p>Maximum number of tasks running in parallel.</p>+<td colspan="3"><p>The maximum number of tasks running in parallel.</p></td></tr><tr><td><code>[options.desiredConcurrencyRatio]</code></td><td><code>Number</code></td><td><code>0.95</code></td></tr>@@ -162,45 +167,46 @@ await pool.run();by the pool.</p></td></tr></tbody></table>-<a name="AutoscaledPool+setMaxConcurrency"></a>+<a name="AutoscaledPool+minConcurrency"></a>-## `autoscaledPool.setMaxConcurrency(maxConcurrency)`-Overrides max concurrency configuration.+## `autoscaledPool.minConcurrency`+Gets the minimum number of tasks running in parallel.-<table>-<thead>-<tr>-<th>Param</th><th>Type</th>-</tr>-</thead>-<tbody>-<tr>-<td><code>maxConcurrency</code></td><td><code>Number</code></td>-</tr>-<tr>-</tr></tbody>-</table>-<a name="AutoscaledPool+setMinConcurrency"></a>+<a name="AutoscaledPool+minConcurrency"></a>-## `autoscaledPool.setMinConcurrency(minConcurrency)`-Overrides min concurrency configuration.+## `autoscaledPool.minConcurrency`+Sets the minimum number of tasks running in parallel.*WARNING:* If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash.If you're not sure, just keep the default value and the concurrency will scale up automatically.-<table>-<thead>-<tr>-<th>Param</th><th>Type</th>-</tr>-</thead>-<tbody>-<tr>-<td><code>minConcurrency</code></td><td><code>Number</code></td>-</tr>-<tr>-</tr></tbody>-</table>+<a name="AutoscaledPool+maxConcurrency"></a>++## `autoscaledPool.maxConcurrency`+Gets the maximum number of tasks running in parallel.++<a name="AutoscaledPool+maxConcurrency"></a>++## `autoscaledPool.maxConcurrency`+Sets the maximum number of tasks running in parallel.++<a name="AutoscaledPool+desiredConcurrency"></a>++## `autoscaledPool.desiredConcurrency`+Gets the desired concurrency for the pool,+which is an estimated number of parallel tasks that the system can currently support.++<a name="AutoscaledPool+desiredConcurrency"></a>++## `autoscaledPool.desiredConcurrency`+Sets the desired concurrency for the pool, i.e. the number of tasks that should be running+in parallel if there's large enough supply of tasks.++<a name="AutoscaledPool+currentConcurrency"></a>++## `autoscaledPool.currentConcurrency`+Gets the the number of parallel tasks currently running in the pool.+<a name="AutoscaledPool+run"></a>## `autoscaledPool.run()` ⇒ <code>Promise</code>diff --git a/docs/api/Dataset.md b/docs/api/Dataset.mdindex 8a0204808..a914d0f67 100644--- a/docs/api/Dataset.md+++ b/docs/api/Dataset.md@@ -195,16 +195,23 @@ Returns items in the dataset based on the provided parameters.## `dataset.getInfo()` ⇒ <code>Promise<Object></code>Returns an object containing general information about the dataset.+The function returns the same object as the Apify API Client's+[getDataset](https://www.apify.com/docs/api/apify-client-js/latest#ApifyClient-datasets-getDataset)+function, which in turn calls the+[Get dataset](https://www.apify.com/docs/api/v2#/reference/datasets/dataset/get-dataset)+API endpoint.+**Example:**```{"id": "WkzbQMuFYuamGv3YF",- "name": "d7b9MDYsbtX5L7XAj",+ "name": "my-dataset","userId": "wRsJZtadYvn4mBZmm",- "createdAt": "2015-12-12T07:34:14.202Z",- "modifiedAt": "2015-12-13T08:36:13.202Z",- "accessedAt": "2015-12-14T08:36:13.202Z",- "itemCount": 0+ "createdAt": new Date("2015-12-12T07:34:14.202Z"),+ "modifiedAt": new Date("2015-12-13T08:36:13.202Z"),+ "accessedAt": new Date("2015-12-14T08:36:13.202Z"),+ "itemCount": 14,+ "cleanItemCount": 10}```@@ -220,7 +227,7 @@ If it throws an error, the iteration is aborted and the `forEach` function throw**Example usage**```javascriptconst dataset = await Apify.openDataset('my-results');-dataset.forEach(async (item, index) => {+await dataset.forEach(async (item, index) => {console.log(`Item at ${index}: ${JSON.stringify(item)}`);});```diff --git a/docs/api/KeyValueStore.md b/docs/api/KeyValueStore.mdindex f62c29ee1..d44a51536 100644--- a/docs/api/KeyValueStore.md+++ b/docs/api/KeyValueStore.md@@ -220,7 +220,7 @@ If it throws an error, the iteration is aborted and the `forEachKey` function th**Example usage**```javascriptconst keyValueStore = await Apify.openKeyValueStore();-keyValueStore.forEachKey(async (key, index, info) => {+await keyValueStore.forEachKey(async (key, index, info) => {console.log(`Key at ${index}: ${key} has size ${info.size}`);});```diff --git a/docs/api/RequestQueue.md b/docs/api/RequestQueue.mdindex 096044e76..59129a7c1 100644--- a/docs/api/RequestQueue.md+++ b/docs/api/RequestQueue.md@@ -78,6 +78,7 @@ await queue.reclaimRequest(request2);* [`.isFinished()`](#RequestQueue+isFinished) ⇒ <code>Promise<Boolean></code>* [`.delete()`](#RequestQueue+delete) ⇒ <code>Promise</code>* [`.handledCount()`](#RequestQueue+handledCount) ⇒ <code>Promise<number></code>+ * [`.getInfo()`](#RequestQueue+getInfo) ⇒ <code>Promise<Object></code><a name="RequestQueue+addRequest"></a>@@ -116,6 +117,7 @@ it will not be updated. You can find out whether this happened from the resultin## `requestQueue.getRequest(requestId)` ⇒ [<code>Promise<Request></code>](request)Gets the request from the queue specified by ID.+**Returns**: [<code>Promise<Request></code>](request) - Returns the request object, or `null` if it was not found.<table><thead><tr>@@ -135,6 +137,7 @@ Gets the request from the queue specified by ID.## `requestQueue.fetchNextRequest()` ⇒ [<code>Promise<Request></code>](request)Returns next request in the queue to be processed.+**Returns**: [<code>Promise<Request></code>](request) - Returns the request object, or `null` if there are no more pending requests.<a name="RequestQueue+markRequestHandled"></a>## `requestQueue.markRequestHandled(request)` ⇒ [<code>Promise<QueueOperationInfo></code>](../typedefs/queueoperationinfo)@@ -210,3 +213,29 @@ depending on the mode of operation.## `requestQueue.handledCount()` ⇒ <code>Promise<number></code>Returns the number of handled requests.+<a name="RequestQueue+getInfo"></a>++## `requestQueue.getInfo()` ⇒ <code>Promise<Object></code>+Returns an object containing general information about the request queue.++The function returns the same object as the Apify API Client's+[getQueue](https://www.apify.com/docs/api/apify-client-js/latest#ApifyClient-requestQueues-getQueue)+function, which in turn calls the+[Get request queue](https://www.apify.com/docs/api/v2#/reference/request-queues/queue/get-request-queue)+API endpoint.++**Example:**+```+{+ "id": "WkzbQMuFYuamGv3YF",+ "name": "my-queue",+ "userId": "wRsJZtadYvn4mBZmm",+ "createdAt": new Date("2015-12-12T07:34:14.202Z"),+ "modifiedAt": new Date("2015-12-13T08:36:13.202Z"),+ "accessedAt": new Date("2015-12-14T08:36:13.202Z"),+ totalRequestCount: 0,+ handledRequestCount: 0,+ pendingRequestCount: 0,+}+```+