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.

Bump version, update Changelog, build docs

Ondra Urban56da0206a9e3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 56b27f156..d8feae7f2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-xxx
+0.13.1 / 2019-03-21
===================
- `Snapshotter` now marks Apify Client overloaded on the basis of 2nd retry errors.
- Added `Apify.addWebhook()` to invoke a webhook when an actor run ends.
diff --git a/docs/api/Apify.md b/docs/api/Apify.md
index 796fc366a..5d6fcdadb 100644
--- a/docs/api/Apify.md
+++ b/docs/api/Apify.md
@@ -10,6 +10,7 @@ accessible from the left sidebar.
* [Apify](#module_Apify)
+ * [`.addWebhook()`](#module_Apify.addWebhook) ⇒ <code>Promise&lt;(Object|undefined)&gt;</code>
* [`.call(actId, [input], [options])`](#module_Apify.call) ⇒ [<code>Promise&lt;ActorRun&gt;</code>](../typedefs/actorrun)
* [`.callTask(taskId, [input], [options])`](#module_Apify.callTask) ⇒ [<code>Promise&lt;ActorRun&gt;</code>](../typedefs/actorrun)
* [`.client`](#module_Apify.client)
@@ -31,6 +32,35 @@ accessible from the left sidebar.
* [`.pushData(item)`](#module_Apify.pushData) ⇒ <code>Promise</code>
* [`.setValue(key, value, [options])`](#module_Apify.setValue) ⇒ <code>Promise</code>
+<a name="module_Apify.addWebhook"></a>
+
+## `Apify.addWebhook()` ⇒ <code>Promise&lt;(Object|undefined)&gt;</code>
+Creates an ad-hoc webhook for the current actor run, which lets you receive a notification when the actor run finished or failed.
+For more information about Apify actor webhooks, please see the <a href="https://apify.com/docs/webhook" target="_blank">documentation</a>.
+
+Note that webhooks are only supported for actors running on the Apify platform.
+In local environment, the function will print a warning and have no effect.
+
+<table>
+<thead>
+<tr>
+<th>Param</th><th>Type</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>options.eventTypes</code></td><td><code>Array&lt;String&gt;</code></td>
+</tr>
+<tr>
+<td colspan="3"><p>Array of event types, which you can set for actor run, see
+the <a href="https://apify.com/docs/webhooks#events-actor-run" target="_blank">actor run events</a> in the Apify doc.</p>
+</td></tr><tr>
+<td><code>options.requestUrl</code></td><td><code>String</code></td>
+</tr>
+<tr>
+<td colspan="3"><p>URL which will be requested using HTTP POST request, when actor run will be in specific event type.</p>
+</td></tr></tbody>
+</table>
<a name="module_Apify.call"></a>
## `Apify.call(actId, [input], [options])` ⇒ [<code>Promise&lt;ActorRun&gt;</code>](../typedefs/actorrun)
diff --git a/docs/examples/HelloWorld.md b/docs/examples/HelloWorld.md
index edd26f905..5ef4f5270 100644
--- a/docs/examples/HelloWorld.md
+++ b/docs/examples/HelloWorld.md
@@ -20,7 +20,7 @@ Apify.main(async () => {
handlePageFunction: async ({ request, page }) => {
const title = await page.title();
console.log(`Title of ${request.url}: ${title}`);
- await Apify.utils.puppeteer.enqueueLinks({ page, selector: 'a', pseudoUrls, requestQueue });
+ await Apify.utils.enqueueLinks({ page, selector: 'a', pseudoUrls, requestQueue });
},
maxRequestsPerCrawl: 100,
maxConcurrency: 10,
diff --git a/docs/examples/PuppeteerCrawler.md b/docs/examples/PuppeteerCrawler.md
index 1e62bf287..c327dc582 100644
--- a/docs/examples/PuppeteerCrawler.md
+++ b/docs/examples/PuppeteerCrawler.md
@@ -73,7 +73,7 @@ Apify.main(async () => {
await Apify.pushData(data);
// Find a link to the next page and enqueue it if it exists.
- const infos = await Apify.utils.puppeteer.enqueueLinks({
+ const infos = await Apify.utils.enqueueLinks({
page,
requestQueue,
selector: '.morelink',
diff --git a/package.json b/package.json
index be3ec7027..d98dcbafe 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
},
"dependencies": {
"@apify/ps-tree": "^1.1.3",
- "apify-client": "^0.5.9",
+ "apify-client": "^0.5.10",
"apify-shared": "^0.1.23",
"bluebird": "^3.5.3",
"cheerio": "^1.0.0-rc.2",