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
Small imrovements of sdk docs
Marek Trunkataee715b552bd
diff --git a/src/dataset.js b/src/dataset.jsindex 61ff60b2f..4954756de 100644--- a/src/dataset.js+++ b/src/dataset.js@@ -141,6 +141,7 @@ const getOrCreateDataset = (datasetIdOrName) => {* @memberof module:Apify* @name openDataset* @instance+ * @function*/export const openDataset = (datasetIdOrName) => {checkParamOrThrow(datasetIdOrName, 'datasetIdOrName', 'Maybe String');@@ -202,5 +203,6 @@ export const openDataset = (datasetIdOrName) => {* @memberof module:Apify* @name pushData* @instance+ * @function*/export const pushData = item => openDataset().then(dataset => dataset.pushData(item));diff --git a/src/index.js b/src/index.jsindex 458a8733b..1e37bdd39 100644--- a/src/index.js+++ b/src/index.js@@ -67,9 +67,11 @@ if (!isProduction() || process.env[ENV_VARS.LOG_LEVEL] === 'DEBUG') log.isDebugM* <h2>Promises vs. callbacks</h2>** By default, all asynchronous functions provided by this package return a promise.- * However, most of them also accept an optional Node.js-style callback as the last parameter.- * If the callback is provided, the return value of the functions is not defined- * and the functions only invoke the callback upon completion or error.+ * But Apify uses a <a href="http://bluebirdjs.com/" target="_blank">Bluebird</a>+ * promise implementation so you can easily convert any function that returns a Promise+ * into callback style function. See <a href="http://bluebirdjs.com/docs/api/promise.promisify.html" target="_blank">+ * http://bluebirdjs.com/docs/api/promise.promisify.html+ * </a> for more information.** <h2>Programmer's reference</h2>*diff --git a/src/key_value_store.js b/src/key_value_store.jsindex 3b49b66e5..993ea8974 100644--- a/src/key_value_store.js+++ b/src/key_value_store.js@@ -269,6 +269,7 @@ const getOrCreateKeyValueStore = (storeIdOrName) => {* @memberof module:Apify* @name openKeyValueStore* @instance+ * @function*/export const openKeyValueStore = (storeIdOrName) => {checkParamOrThrow(storeIdOrName, 'storeIdOrName', 'Maybe String');@@ -342,6 +343,7 @@ export const openKeyValueStore = (storeIdOrName) => {* @memberof module:Apify* @name getValue* @instance+ * @function*/export const getValue = key => openKeyValueStore().then(store => store.getValue(key));@@ -385,5 +387,6 @@ export const getValue = key => openKeyValueStore().then(store => store.getValue(* @memberof module:Apify* @name setValue* @instance+ * @function*/export const setValue = (key, value, options) => openKeyValueStore().then(store => store.setValue(key, value, options));diff --git a/src/puppeteer.js b/src/puppeteer.jsindex ca9ad7cf1..ccb14ab0a 100644--- a/src/puppeteer.js+++ b/src/puppeteer.js@@ -41,6 +41,7 @@ import { newPromise } from './utils';* @memberof module:Apify* @name launchPuppeteer* @instance+ * @function*/export const launchPuppeteer = (opts) => {if (opts === undefined || opts === null) opts = {};diff --git a/src/utils.js b/src/utils.jsindex 27d3228f7..bdf82d15e 100644--- a/src/utils.js+++ b/src/utils.js@@ -98,18 +98,18 @@ const createIsDockerPromise = () => {};/**- * Returns promise that resolves to true if the code is running in Docker container.+ * Returns promise that resolves to true if the code is running in a Docker container.* See https://github.com/sindresorhus/is-docker*- * Parameter forceReset is just internal for unit tests.- ** @return {Promise}** @memberof module:Apify* @name isDocker* @instance+ * @function*/export const isDocker = (forceReset) => {+ // Parameter forceReset is just internal for unit tests.if (!isDockerPromise || forceReset) isDockerPromise = createIsDockerPromise();return isDockerPromise;@@ -136,6 +136,7 @@ export const isDocker = (forceReset) => {* @memberof module:Apify* @name getMemoryInfo* @instance+ * @function*/export const getMemoryInfo = () => {// module.exports must be here so that we can mock it.diff --git a/src/webdriver.js b/src/webdriver.jsindex 0cad1937e..450992410 100644--- a/src/webdriver.js+++ b/src/webdriver.js@@ -298,6 +298,7 @@ export const browse = (url, options) => {* @memberof module:Apify* @name launchWebDriver* @instance+ * @function*/export const launchWebDriver = (opts) => {const args = processBrowseArgs(undefined, opts);