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.

Documenting

Marek Trunkat09404e7881ba
diff --git a/README.md b/README.md
index 5978841d7..488caab86 100644
--- a/README.md
+++ b/README.md
@@ -3,13 +3,8 @@
[![npm version](https://badge.fury.io/js/apify.svg)](http://badge.fury.io/js/apify)
[![Build Status](https://travis-ci.org/apifytech/apify-js.svg)](https://travis-ci.org/apifytech/apify-js)
-Helper package that simplifies development of acts on the Apify Actor platform.
+The apify NPM package simplifies development of acts in Apify Actor - a serverless computing platform that enables execution of arbitrary pieces of code in the cloud. The package provides helper functions to launch web browsers with proxies, access the storage etc. Note that the usage of the package is optional, you can create acts without it.
-Complete documentation is available at https://www.apify.com/docs/sdk/apify-runtime-js/latest
+Complete documentation of this package is available at https://www.apify.com/docs/sdk/apify-runtime-js/latest
-For more information about the Apify Actor platform, please see https://www.apify.com/docs/actor
-
-
-If you're looking for the API documentation package previously published as **apify**,
-please go to [jsdocify](https://www.npmjs.com/package/jsdocify).
-Big kudos to [jbalsas](https://www.npmjs.com/~jbalsas) for giving away this package name!
+For more information about the Apify Actor platform, please see https://www.apify.com/docs/actor
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 1e37bdd39..9c6ce4657 100644
--- a/src/index.js
+++ b/src/index.js
@@ -36,7 +36,6 @@ if (!isProduction() || process.env[ENV_VARS.LOG_LEVEL] === 'DEBUG') log.isDebugM
* <h2>Example usage</h2>
*
* ```javascript
- * &nbsp;
* Apify.main(async () => {
* // Get input of the act
* const input = await Apify.getValue('INPUT');
@@ -53,6 +52,48 @@ if (!isProduction() || process.env[ENV_VARS.LOG_LEVEL] === 'DEBUG') log.isDebugM
* });
* ```
*
+ * <h2>Main use-cases</h2>
+ *
+ * Main goal of this package is to help with implementation of web scraping and automation projects. Some of the
+ * most common use-cases are:
+ *
+ * <ul>
+ * <li>
+ * If you need to process high volume of <strong>asynchronous tasks in parallel</strong> then take a
+ * look at <a href="#AutoscaledPool">AutoscaledPool</a>. This class executes defined tasks in a pool
+ * which size is scaled based on available memory and CPU.
+ * </li>
+ * <li>
+ * If you want to <strong>crawl</strong> a list of urls using for example <a href="https://www.npmjs.com/package/request" target="_blank">
+ * Request</a> package then import those url as a <a href="#RequestList">RequestList</a> and then use
+ * <a href="#BasicCrawler">BasicCrawler</a> to process them in a pool.
+ * </li>
+ * <li>
+ * If you want to crawl a list of urls but you need a real <strong>browser</strong>. Then use
+ * <a href="#PuppeteerCrawler">PuppeteerCrawler</a> which helps you to process a <a href="#RequestList">RequestList</a>
+ * using <a href="https://github.com/GoogleChrome/puppeteer" target="_blank">Puppeteer</a> (headless Chrome browser).
+ * </li>
+ * </ul>
+ *
+ * <h2>Puppeteer</h2>
+ *
+ * For those who are using <a href="https://github.com/GoogleChrome/puppeteer" target="_blank">Puppeteer</a> (headless Chrome browser)
+ * we have few helper classes and functions:
+ *
+ * <ul>
+ * <li>
+ * `Apify.launchPuppeteer()` function starts new instance of Puppeteer browser and returns its browser object.
+ * </li>
+ * <li>
+ * <a href="#PuppeteerPool">PuppeteerPool</a> helps to mantain a pool of Puppeteer instances. This is usefull
+ * when you need to restart browser after certain number of requests to rotate proxy servers.
+ * </li>
+ * <li>
+ * <a href="#PuppeteerCrawler">PuppeteerCrawler</a> helps to crawl a <a href="#RequestList">RequestList</a>
+ * in a autoscaled pool.
+ * </li>
+ * </ul>
+ *
* <h2>Installation</h2>
*
* This package requires Node.js 6 or higher. It might work with lower versions too,