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.

feat: add `Dataset.getData()` shortcut

Martin Adámek522ed6e209ae
diff --git a/packages/core/src/storages/dataset.ts b/packages/core/src/storages/dataset.ts
index efe6778aa..7ec04739e 100644
--- a/packages/core/src/storages/dataset.ts
+++ b/packages/core/src/storages/dataset.ts
@@ -465,6 +465,14 @@ export class Dataset<Data extends Dictionary = Dictionary> {
const dataset = await this.open();
return dataset.pushData(item);
}
+
+ /**
+ * Returns {@apilink DatasetContent} object holding the items in the dataset based on the provided parameters.
+ */
+ static async getData<Data extends Dictionary = Dictionary>(options: DatasetDataOptions = {}): Promise<DatasetContent<Data>> {
+ const dataset = await this.open();
+ return dataset.getData(options);
+ }
}
/**