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.

Be more explicit about state in RequestList docs (#708)

Lukáš Křivka15b0c955ad36
diff --git a/src/request_list.js b/src/request_list.js
index 243fe35a1..004c87bd8 100644
--- a/src/request_list.js
+++ b/src/request_list.js
@@ -174,7 +174,7 @@ const CONTENT_TYPE_BINARY = 'application/octet-stream';
* **Basic usage:**
* ```javascript
* // Use a helper function to simplify request list initialization.
- * // State and sources are automatically persisted.
+ * // State and sources are automatically persisted. This is a preferred usage.
* const requestList = await Apify.openRequestList('my-request-list', [
* 'http://www.example.com/page-1',
* { url: 'http://www.example.com/page-2', method: 'POST', userData: { foo: 'bar' }},
@@ -196,7 +196,8 @@ const CONTENT_TYPE_BINARY = 'application/octet-stream';
* { requestsFromUrl: 'http://www.example.com/my-url-list.txt', userData: { isFromUrl: true } },
* ],
*
- * // Persist only state in cases where the original sources are immutable to improve performance.
+ * // Persist the state to avoid re-crawling which can lead to data duplications.
+ * // Keep in mind that the sources have to be immutable or this will throw an error.
* persistStateKey: 'my-state',
* });
*