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 Urban583b728f9c00
diff --git a/docs/api/Apify.md b/docs/api/Apify.mdindex 69eac2e5b..adbcff589 100644--- a/docs/api/Apify.md+++ b/docs/api/Apify.md@@ -271,6 +271,9 @@ The following table shows all currently emitted events:their state, in order to avoid repeating all work when the actor restarts.This event is automatically emitted together with the <code>migrating</code> event,in which case the <code>isMigrating</code> flag is set to <code>true</code>. Otherwise the flag is <code>false</code>.+ <br><br>+ Note that the <code>persistState</code> event is provided merely for user convenience,+ you can achieve the same effect using `setInterval()` and listening for the `migrating` event.</td></tr></tbody>@@ -654,8 +657,8 @@ For more details and code examples, see the [`Dataset`](dataset) class.<td><code>[options.forceCloud]</code></td><td><code>boolean</code></td><td><code>false</code></td></tr><tr>-<td colspan="3"><p>If set to <code>true</code> then enforces cloud storage usage. This way is possible to combine local and- cloud storages when devloping locally.</p>+<td colspan="3"><p>If set to <code>true</code> then the function uses cloud storage usage even if the <code>APIFY_LOCAL_STORAGE_DIR</code>+ environment variable is set. This way it is possible to combine local and cloud storage.</p></td></tr></tbody></table><a name="module_Apify.openKeyValueStore"></a>@@ -690,8 +693,8 @@ For more details and code examples, see the [`KeyValueStore`](keyvaluestore) cla<td><code>[options.forceCloud]</code></td><td><code>boolean</code></td><td><code>false</code></td></tr><tr>-<td colspan="3"><p>If set to <code>true</code> then enforces cloud storage usage. This way is possible to combine local and- cloud storages when devloping locally.</p>+<td colspan="3"><p>If set to <code>true</code> then the function uses cloud storage usage even if the <code>APIFY_LOCAL_STORAGE_DIR</code>+ environment variable is set. This way it is possible to combine local and cloud storage.</p></td></tr></tbody></table><a name="module_Apify.openRequestQueue"></a>@@ -728,8 +731,8 @@ For more details and code examples, see the [`RequestQueue`](requestqueue) class<td><code>[options.forceCloud]</code></td><td><code>boolean</code></td><td><code>false</code></td></tr><tr>-<td colspan="3"><p>If set to <code>true</code> then enforces cloud storage usage. This way is possible to combine local and- cloud storages when devloping locally.</p>+<td colspan="3"><p>If set to <code>true</code> then the function uses cloud storage usage even if the <code>APIFY_LOCAL_STORAGE_DIR</code>+ environment variable is set. This way it is possible to combine local and cloud storage.</p></td></tr></tbody></table><a name="module_Apify.pushData"></a>diff --git a/docs/api/Dataset.md b/docs/api/Dataset.mdindex b6f04de72..710e6354e 100644--- a/docs/api/Dataset.md+++ b/docs/api/Dataset.md@@ -25,8 +25,11 @@ Note that `{DATASET_ID}` is the name or ID of the dataset. The default dataset hunless you override it by setting the `APIFY_DEFAULT_DATASET_ID` environment variable.Each dataset item is stored as a separate JSON file, where `{INDEX}` is a zero-based index of the item in the dataset.-If the `APIFY_TOKEN` environment variable is provided instead, the data are stored-in the <a href="https://www.apify.com/docs/storage#dataset" target="_blank">Apify Dataset</a> cloud storage.+If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the+<a href="https://www.apify.com/docs/storage#dataset" target="_blank">Apify Dataset</a>+cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`+option to [`Apify.openDataset()`](apify#module_Apify.openDataset) function,+even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.**Example usage:**diff --git a/docs/api/KeyValueStore.md b/docs/api/KeyValueStore.mdindex ac211f9cf..1bce0a512 100644--- a/docs/api/KeyValueStore.md+++ b/docs/api/KeyValueStore.md@@ -32,9 +32,11 @@ Note that `{STORE_ID}` is the name or ID of the key-value store. The default keyunless you override it by setting the `APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable.The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the data value.-If the `APIFY_TOKEN` environment variable is provided instead, the data is stored in the-<a href="https://www.apify.com/docs/storage#key-value-store" target="_blank">Apify Key-Value Store</a>-cloud storage.+If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the+<a href="https://www.apify.com/docs/storage#key-value-store" target="_blank">Apify Key-value store</a>+cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`+option to [`Apify.openKeyValueStore()`](apify#module_Apify.openKeyValueStore) function,+even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.**Example usage:**@@ -105,7 +107,8 @@ const buffer = await store.getValue('screenshot1.png');<td><code>key</code></td><td><code>String</code></td></tr><tr>-<td colspan="3"><p>Unique key of the record.</p>+<td colspan="3"><p>Unique key of the record. It can be at most 256 characters long and only consist+ of the following characters: <code>[a-zA-Z0-9!-_.'()</code></p></td></tr></tbody></table><a name="KeyValueStore+setValue"></a>@@ -121,6 +124,8 @@ const store = await Apify.openKeyValueStore('my-store');await store.setValue('RESULTS', 'my text data', { contentType: 'text/plain' });```+Beware that the key can be at most 256 characters long and only contain the following characters: `a-zA-Z0-9!-_.'()`+By default, `value` is converted to JSON and stored with the`application/json; charset=utf-8` MIME content type.To store the value with another content type, pass it in the options as follows:@@ -151,7 +156,8 @@ otherwise the actor process might finish before the value is stored!<td><code>key</code></td><td><code>String</code></td></tr><tr>-<td colspan="3"><p>Unique key of the record.</p>+<td colspan="3"><p>Unique key of the record. It can be at most 256 characters long and only consist+ of the following characters: <code>[a-zA-Z0-9!-_.'()</code></p></td></tr><tr><td><code>value</code></td><td><code>Object</code> | <code>String</code> | <code>Buffer</code></td></tr>diff --git a/docs/api/RequestQueue.md b/docs/api/RequestQueue.mdindex 2c2d19618..114fcebde 100644--- a/docs/api/RequestQueue.md+++ b/docs/api/RequestQueue.md@@ -35,8 +35,11 @@ unless you override it by setting the `APIFY_DEFAULT_REQUEST_QUEUE_ID` environmeEach request in the queue is stored as a separate JSON file, where `{STATE}` is either `handled` or `pending`,and `{NUMBER}` is an integer indicating the position of the request in the queue.-If the `APIFY_TOKEN` environment variable is provided instead, the data is stored-in the <a href="https://www.apify.com/docs/storage#queue" target="_blank">Apify Request Queue</a> cloud storage.+If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the+<a href="https://www.apify.com/docs/storage#queue" target="_blank">Apify Request Queue</a>+cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`+option to [`Apify.openRequestQueue()`](apify#module_Apify.openRequestQueue) function,+even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.**Example usage:**