@crawlee/cheerio 3.0.0-beta.8 → 3.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -133
- package/index.mjs +8 -0
- package/internals/cheerio-crawler.d.ts +92 -185
- package/internals/cheerio-crawler.d.ts.map +1 -1
- package/internals/cheerio-crawler.js +62 -24
- package/internals/cheerio-crawler.js.map +1 -1
- package/package.json +15 -11
- package/tsconfig.build.tsbuildinfo +1 -1
package/README.md
CHANGED
|
@@ -1,183 +1,139 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<a href="https://crawlee.dev">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-dark.svg?sanitize=true">
|
|
5
|
+
<img alt="Crawlee" src="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-light.svg?sanitize=true" width="500">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
<br>
|
|
9
|
+
<small>The scalable web crawling and scraping library for JavaScript</small>
|
|
10
|
+
</h1>
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
<p align=center>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/v/@crawlee/core.svg" alt="NPM latest version" data-canonical-src="https://img.shields.io/npm/v/@crawlee/core/next.svg" style="max-width: 100%;"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/dm/@crawlee/core.svg" alt="Downloads" data-canonical-src="https://img.shields.io/npm/dm/@crawlee/core.svg" style="max-width: 100%;"></a>
|
|
15
|
+
<a href="https://discord.gg/jyEM2PRvMU" rel="nofollow"><img src="https://img.shields.io/discord/801163717915574323?label=discord" alt="Chat on discord" data-canonical-src="https://img.shields.io/discord/801163717915574323?label=discord" style="max-width: 100%;"></a>
|
|
16
|
+
<a href="https://github.com/apify/crawlee/actions/workflows/test-and-release.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-and-release.yml/badge.svg?branch=master" alt="Build Status" style="max-width: 100%;"></a>
|
|
17
|
+
</p>
|
|
4
18
|
|
|
5
|
-
[
|
|
6
|
-
[](https://www.npmjs.com/package/@crawlee/core)
|
|
7
|
-
[](https://discord.gg/jyEM2PRvMU)
|
|
8
|
-
[](https://github.com/apify/apify-ts/actions/workflows/test-and-release.yml)
|
|
19
|
+
>👉👉👉 Crawlee is the successor to [Apify SDK](https://sdk.apify.com). 🎉 Fully rewritten in **TypeScript** for a better developer experience, and with even more powerful anti-blocking features. The interface is almost the same as Apify SDK so upgrading is a breeze. Read [the upgrading guide](https://crawlee.dev/docs/upgrading/upgrading-to-v3) to learn about the changes. 👈👈👈
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
It provides tools to manage and automatically scale a pool of headless browsers,
|
|
12
|
-
to maintain queues of URLs to crawl, store crawling results to a local filesystem or into the cloud,
|
|
13
|
-
rotate proxies and much more.
|
|
14
|
-
The SDK is available as the [`apify`](https://www.npmjs.com/package/apify) NPM package.
|
|
15
|
-
It can be used either stand-alone in your own applications
|
|
16
|
-
or in [actors](https://docs.apify.com/actor)
|
|
17
|
-
running on the [Apify Cloud](https://apify.com/).
|
|
21
|
+
Crawlee simplifies the development of web crawlers, scrapers, data extractors and web automation jobs. It provides tools to manage and automatically scale a pool of headless browsers, to maintain queues of URLs to crawl, store crawling results to a local filesystem or into the cloud, rotate proxies and much more. Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) NPM package. It can be used either stand-alone in your own applications or in [actors](https://docs.apify.com/actor) running on the [Apify Cloud](https://apify.com/).
|
|
18
22
|
|
|
19
|
-
**View full documentation, guides and examples on the [
|
|
23
|
+
**View full documentation, guides and examples on the [Crawlee project website](https://crawlee.dev)**
|
|
20
24
|
|
|
21
|
-
> Would you like to work with us on
|
|
25
|
+
> Would you like to work with us on Crawlee or similar projects? [We are hiring!](https://apify.com/jobs#senior-node.js-engineer)
|
|
22
26
|
|
|
23
27
|
## Motivation
|
|
24
28
|
|
|
25
|
-
Thanks to tools like [Playwright](https://github.com/microsoft/playwright), [Puppeteer](https://github.com/puppeteer/puppeteer) or
|
|
26
|
-
[Cheerio](https://www.npmjs.com/package/cheerio), it is easy to write Node.js code to extract data from web pages. But
|
|
27
|
-
eventually things will get complicated. For example, when you try to:
|
|
29
|
+
Thanks to tools like [Playwright](https://github.com/microsoft/playwright), [Puppeteer](https://github.com/puppeteer/puppeteer) or [Cheerio](https://www.npmjs.com/package/cheerio), it is easy to write Node.js code to extract data from web pages. But eventually things will get complicated. For example, when you try to:
|
|
28
30
|
|
|
29
31
|
- Perform a deep crawl of an entire website using a persistent queue of URLs.
|
|
30
32
|
- Run your scraping code on a list of 100k URLs in a CSV file, without losing any data when your code crashes.
|
|
31
33
|
- Rotate proxies to hide your browser origin and keep user-like sessions.
|
|
32
34
|
- Disable browser fingerprinting protections used by websites.
|
|
33
35
|
|
|
34
|
-
Python has [Scrapy](https://scrapy.org/) for these tasks, but there was no such library for **JavaScript, the language of
|
|
35
|
-
the web**. The use of JavaScript is natural, since the same language is used to write the scripts as well as the data extraction code running in a
|
|
36
|
-
browser.
|
|
36
|
+
Python has [Scrapy](https://scrapy.org/) for these tasks, but there was no such library for **JavaScript, the language of the web**. The use of JavaScript is natural, since the same language is used to write the scripts as well as the data extraction code running in a browser.
|
|
37
37
|
|
|
38
|
-
The goal of
|
|
39
|
-
reinvent the wheel every time you need data from the web, and focus on writing code specific to the target website, rather than developing
|
|
40
|
-
commonalities.
|
|
38
|
+
The goal of Crawlee is to fill this gap and provide a toolbox for generic web scraping, crawling and automation tasks in JavaScript. So don't reinvent the wheel every time you need data from the web, and focus on writing code specific to the target website, rather than developing commonalities.
|
|
41
39
|
|
|
42
40
|
## Overview
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) NPM package and is also available via `@crawlee/*` packages. It provides the following tools:
|
|
45
43
|
|
|
46
|
-
- [`CheerioCrawler`](https://
|
|
47
|
-
number of web pages using the [cheerio](https://www.npmjs.com/package/cheerio) HTML parser. This is the most
|
|
48
|
-
efficient web crawler, but it does not work on websites that require JavaScript.
|
|
44
|
+
- [`CheerioCrawler`](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler) - Enables the parallel crawling of a large number of web pages using the [cheerio](https://www.npmjs.com/package/cheerio) HTML parser. This is the most efficient web crawler, but it does not work on websites that require JavaScript. Available also under `@crawlee/cheerio` package.
|
|
49
45
|
|
|
50
|
-
- [`PuppeteerCrawler`](https://
|
|
51
|
-
a large number of web pages using the headless Chrome browser and [Puppeteer](https://github.com/puppeteer/puppeteer).
|
|
52
|
-
The pool of Chrome browsers is automatically scaled up and down based on available system resources.
|
|
46
|
+
- [`PuppeteerCrawler`](https://crawlee.dev/api/puppeteer-crawler/class/PuppeteerCrawler) - Enables the parallel crawling of a large number of web pages using the headless Chrome browser and [Puppeteer](https://github.com/puppeteer/puppeteer). The pool of Chrome browsers is automatically scaled up and down based on available system resources. Available also under `@crawlee/puppeteer` package.
|
|
53
47
|
|
|
54
|
-
- [`PlaywrightCrawler`](https://
|
|
55
|
-
you can use [Playwright](https://github.com/microsoft/playwright) to manage almost any headless browser.
|
|
56
|
-
It also provides a cleaner and more mature interface while keeping the ease of use and advanced features.
|
|
48
|
+
- [`PlaywrightCrawler`](https://crawlee.dev/api/playwright-crawler/class/PlaywrightCrawler) - Unlike `PuppeteerCrawler` you can use [Playwright](https://github.com/microsoft/playwright) to manage almost any headless browser. It also provides a cleaner and more mature interface while keeping the ease of use and advanced features. Available also under `@crawlee/playwright` package.
|
|
57
49
|
|
|
58
|
-
- [`BasicCrawler`](https://
|
|
59
|
-
crawling of web pages whose URLs are fed either from a static list or from a dynamic queue of URLs. This class
|
|
60
|
-
serves as a base for the more specialized crawlers above.
|
|
50
|
+
- [`BasicCrawler`](https://crawlee.dev/api/basic-crawler/class/BasicCrawler) - Provides a simple framework for the parallel crawling of web pages whose URLs are fed either from a static list or from a dynamic queue of URLs. This class serves as a base for the more specialized crawlers above. Available also under `@crawlee/basic` package.
|
|
61
51
|
|
|
62
|
-
- [`RequestList`](https://
|
|
63
|
-
The URLs can be passed in code or in a text file hosted on the web. The list persists its state so that crawling
|
|
64
|
-
can resume when the Node.js process restarts.
|
|
52
|
+
- [`RequestList`](https://crawlee.dev/api/core/class/RequestList) - Represents a list of URLs to crawl. The URLs can be passed in code or in a text file hosted on the web. The list persists its state so that crawling can resume when the Node.js process restarts. Available also under `@crawlee/core` package.
|
|
65
53
|
|
|
66
|
-
- [`RequestQueue`](https://
|
|
67
|
-
which is stored either on a local filesystem or in the [Apify Cloud](https://apify.com). The queue is used
|
|
68
|
-
for deep crawling of websites, where you start with several URLs and then recursively follow links to other pages.
|
|
69
|
-
The data structure supports both breadth-first and depth-first crawling orders.
|
|
54
|
+
- [`RequestQueue`](https://crawlee.dev/api/core/class/RequestQueue) - Represents a queue of URLs to crawl, which is stored either in memory, on a local filesystem, or in the [Apify Cloud](https://apify.com). The queue is used for deep crawling of websites, where you start with several URLs and then recursively follow links to other pages. The data structure supports both breadth-first and depth-first crawling orders. Available also under `@crawlee/core` package.
|
|
70
55
|
|
|
71
|
-
- [`Dataset`](https://
|
|
72
|
-
to formats like JSON, JSONL, CSV, XML, Excel or HTML. The data is stored on a local filesystem or in the Apify Cloud.
|
|
73
|
-
Datasets are useful for storing and sharing large tabular crawling results, such as a list of products or real estate offers.
|
|
56
|
+
- [`Dataset`](https://crawlee.dev/api/core/class/Dataset) - Provides a store for structured data and enables their export to formats like JSON, JSONL, CSV, XML, Excel or HTML. The data is stored on a local filesystem or in the Apify Cloud. Datasets are useful for storing and sharing large tabular crawling results, such as a list of products or real estate offers. Available also under `@crawlee/core` package.
|
|
74
57
|
|
|
75
|
-
- [`KeyValueStore`](https://
|
|
76
|
-
records or files, along with their MIME content type. It is ideal for saving screenshots of web pages, PDFs
|
|
77
|
-
or to persist the state of your crawlers. The data is stored on a local filesystem or in the Apify Cloud.
|
|
58
|
+
- [`KeyValueStore`](https://crawlee.dev/api/core/class/KeyValueStore) - A simple key-value store for arbitrary data records or files, along with their MIME content type. It is ideal for saving screenshots of web pages, PDFs or to persist the state of your crawlers. The data is stored on a local filesystem or in the Apify Cloud. Available also under `@crawlee/core` package.
|
|
78
59
|
|
|
79
|
-
- [`AutoscaledPool`](https://
|
|
80
|
-
while automatically adjusting the concurrency based on free system memory and CPU usage. This is useful for running
|
|
81
|
-
web scraping tasks at the maximum capacity of the system.
|
|
60
|
+
- [`AutoscaledPool`](https://crawlee.dev/api/core/class/AutoscaledPool) - Runs asynchronous background tasks, while automatically adjusting the concurrency based on free system memory and CPU usage. This is useful for running web scraping tasks at the maximum capacity of the system. Available also under `@crawlee/core` package.
|
|
82
61
|
|
|
83
|
-
|
|
84
|
-
for web scraping. For example, to inject jQuery into web pages or to hide browser origin.
|
|
85
|
-
|
|
86
|
-
Additionally, the package provides various helper functions to simplify running your code on the Apify Cloud and thus
|
|
87
|
-
take advantage of its pool of proxies, job scheduler, data storage, etc.
|
|
88
|
-
For more information, see the [Apify SDK Programmer's Reference](https://sdk.apify.com).
|
|
62
|
+
Additionally, the package provides various helper functions to simplify running your code on the Apify Cloud and thus take advantage of its pool of proxies, job scheduler, data storage, etc. For more information, see the [Crawlee Programmer's Reference](https://crawlee.dev).
|
|
89
63
|
|
|
90
64
|
## Quick Start
|
|
91
65
|
|
|
92
|
-
This short tutorial will set you up to start using
|
|
93
|
-
If you want to learn more, proceed to the [Getting Started](https://sdk.apify.com/docs/guides/getting-started)
|
|
94
|
-
tutorial that will take you step by step through creating your first scraper.
|
|
66
|
+
This short tutorial will set you up to start using Crawlee in a minute or two. If you want to learn more, proceed to the [Getting Started](https://crawlee.dev/docs/guides/getting-started) tutorial that will take you step by step through creating your first scraper.
|
|
95
67
|
|
|
96
68
|
### Local stand-alone usage
|
|
97
69
|
|
|
98
|
-
|
|
99
|
-
Add Apify SDK to any Node.js project by running:
|
|
70
|
+
Crawlee requires [Node.js](https://nodejs.org/en/) 16 or later. Add Crawlee to any Node.js project by running:
|
|
100
71
|
|
|
101
72
|
```bash
|
|
102
|
-
npm install
|
|
73
|
+
npm install crawlee playwright
|
|
103
74
|
```
|
|
104
75
|
|
|
105
|
-
> Neither `playwright` nor `puppeteer` are bundled with
|
|
106
|
-
> flexibility. That's why we install it with NPM. You can choose one, both, or neither.
|
|
76
|
+
> Neither `playwright` nor `puppeteer` are bundled with Crawlee to reduce install size and allow greater flexibility. That's why we install it with NPM. You can choose one, both, or neither.
|
|
107
77
|
|
|
108
|
-
Run the following example to perform a recursive crawl of a website using Playwright. For more examples showcasing various features of the
|
|
109
|
-
[see the Examples section of the documentation](https://sdk.apify.com/docs/examples/crawl-multiple-urls).
|
|
78
|
+
Run the following example to perform a recursive crawl of a website using Playwright. For more examples showcasing various features of Crawlee, [see the Examples section of the documentation](https://crawlee.dev/docs/examples/crawl-multiple-urls).
|
|
110
79
|
|
|
111
80
|
```javascript
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
console.log(`Title of ${request.url}: ${title}`);
|
|
126
|
-
|
|
127
|
-
// Add URLs that match the provided pattern.
|
|
128
|
-
await Apify.utils.enqueueLinks({
|
|
129
|
-
page,
|
|
130
|
-
requestQueue,
|
|
131
|
-
pseudoUrls: ['https://www.iana.org/[.*]'],
|
|
132
|
-
});
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
await crawler.run();
|
|
81
|
+
import { PlaywrightCrawler, Dataset } from 'crawlee';
|
|
82
|
+
|
|
83
|
+
const crawler = new PlaywrightCrawler();
|
|
84
|
+
|
|
85
|
+
crawler.router.addDefaultHandler(async ({ request, page, enqueueLinks }) => {
|
|
86
|
+
const title = await page.title();
|
|
87
|
+
console.log(`Title of ${request.loadedUrl} is '${title}'`);
|
|
88
|
+
|
|
89
|
+
// save some results
|
|
90
|
+
await Dataset.pushData({ title, url: request.loadedUrl });
|
|
91
|
+
|
|
92
|
+
// enqueue all links targeting the same hostname
|
|
93
|
+
await enqueueLinks();
|
|
137
94
|
});
|
|
95
|
+
|
|
96
|
+
await crawler.run(['https://www.iana.org/']);
|
|
138
97
|
```
|
|
139
98
|
|
|
140
|
-
When you run the example, you should see
|
|
99
|
+
When you run the example, you should see Crawlee automating a Chrome browser.
|
|
141
100
|
|
|
142
|
-

|
|
143
102
|
|
|
144
|
-
By default,
|
|
145
|
-
`APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variable. For details, see [Environment variables](https://sdk.apify.com/docs/guides/environment-variables), [Request storage](https://sdk.apify.com/docs/guides/request-storage) and [Result storage](https://sdk.apify.com/docs/guides/result-storage).
|
|
103
|
+
By default, Crawlee stores data to `./storage` in the current working directory. You can override this directory via `CRAWLEE_STORAGE_DIR` env var. For details, see [Environment variables](https://crawlee.dev/docs/guides/environment-variables), [Request storage](https://crawlee.dev/docs/guides/request-storage) and [Result storage](https://crawlee.dev/docs/guides/result-storage).
|
|
146
104
|
|
|
147
|
-
### Local usage with
|
|
105
|
+
### Local usage with Crawlee command-line interface (CLI)
|
|
148
106
|
|
|
149
|
-
To
|
|
150
|
-
the [Apify platform](https://sdk.apify.com/docs/guides/apify-platform), you can use the [Apify command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
|
|
107
|
+
To create a boilerplate of your project we can use the [Crawlee command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
|
|
151
108
|
|
|
152
|
-
|
|
109
|
+
Let's create a boilerplate of your new web crawling project by running:
|
|
153
110
|
|
|
154
111
|
```bash
|
|
155
|
-
|
|
112
|
+
npx crawlee create my-hello-world
|
|
156
113
|
```
|
|
157
114
|
|
|
158
|
-
|
|
115
|
+
The CLI will prompt you to select a project boilerplate template - just pick "Hello world". The tool will create a directory called `my-hello-world` with a Node.js project files. You can run the project as follows:
|
|
159
116
|
|
|
160
117
|
```bash
|
|
161
|
-
|
|
118
|
+
cd my-hello-world
|
|
119
|
+
npx crawlee run
|
|
162
120
|
```
|
|
163
121
|
|
|
164
|
-
|
|
165
|
-
with a Node.js project files. You can run the project as follows:
|
|
122
|
+
By default, the crawling data will be stored in a local directory at `./storage`. For example, the input JSON file for the actor is expected to be in the default key-value store in `./storage/key_value_stores/default/INPUT.json`.
|
|
166
123
|
|
|
167
|
-
|
|
168
|
-
cd my-hello-world
|
|
169
|
-
apify run
|
|
170
|
-
```
|
|
124
|
+
### Usage on the Apify platform
|
|
171
125
|
|
|
172
|
-
|
|
173
|
-
be in the default key-value store in `./apify_storage/key_value_stores/default/INPUT.json`.
|
|
126
|
+
Now if we want to run our new crawler on Apify Platform, we first need to download the `apify-cli` and login with our token:
|
|
174
127
|
|
|
175
|
-
|
|
128
|
+
> We could also use the Apify CLI to generate a new project, which can be better suited if we want to run it on the Apify Platform.
|
|
176
129
|
|
|
177
130
|
```bash
|
|
131
|
+
npm i -g apify-cli
|
|
178
132
|
apify login
|
|
179
133
|
```
|
|
180
134
|
|
|
135
|
+
Finally, we can easily deploy our code to the Apify platform by running:
|
|
136
|
+
|
|
181
137
|
```bash
|
|
182
138
|
apify push
|
|
183
139
|
```
|
|
@@ -185,32 +141,18 @@ apify push
|
|
|
185
141
|
Your script will be uploaded to the Apify platform and built there so that it can be run. For more information, view the
|
|
186
142
|
[Apify Actor](https://docs.apify.com/cli) documentation.
|
|
187
143
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
You can also develop your web scraping project in an online code editor directly on the [Apify platform](https://sdk.apify.com/docs/guides/apify-platform).
|
|
191
|
-
You'll need to have an Apify Account. Go to [Actors](https://console.apify.com/actors), page in the Apify Console, click <i>Create new</i>
|
|
192
|
-
and then go to the <i>Source</i> tab and start writing your code or paste one of the examples from the Examples section.
|
|
144
|
+
You can also develop your web scraping project in an online code editor directly on the [Apify platform](https://crawlee.dev/docs/guides/apify-platform). You'll need to have an Apify Account. Go to [Actors](https://console.apify.com/actors), page in the Apify Console, click <i>Create new</i> and then go to the <i>Source</i> tab and start writing your code or paste one of the examples from the Examples section.
|
|
193
145
|
|
|
194
146
|
For more information, view the [Apify actors quick start guide](https://docs.apify.com/actor/quick-start).
|
|
195
147
|
|
|
196
148
|
## Support
|
|
197
149
|
|
|
198
|
-
If you find any bug or issue with
|
|
199
|
-
For questions, you can ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/apify) or contact support@apify.com
|
|
150
|
+
If you find any bug or issue with Crawlee, please [submit an issue on GitHub](https://github.com/apify/crawlee/issues). For questions, you can ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/apify) or contact support@apify.com
|
|
200
151
|
|
|
201
152
|
## Contributing
|
|
202
153
|
|
|
203
|
-
Your code contributions are welcome and you'll be praised to eternity!
|
|
204
|
-
If you have any ideas for improvements, either submit an issue or create a pull request.
|
|
205
|
-
For contribution guidelines and the code of conduct,
|
|
206
|
-
see [CONTRIBUTING.md](https://github.com/apify/apify-js/blob/master/CONTRIBUTING.md).
|
|
154
|
+
Your code contributions are welcome, and you'll be praised to eternity! If you have any ideas for improvements, either submit an issue or create a pull request. For contribution guidelines and the code of conduct, see [CONTRIBUTING.md](https://github.com/apify/crawlee/blob/master/CONTRIBUTING.md).
|
|
207
155
|
|
|
208
156
|
## License
|
|
209
157
|
|
|
210
|
-
This project is licensed under the Apache License 2.0 -
|
|
211
|
-
see the [LICENSE.md](https://github.com/apify/apify-js/blob/master/LICENSE.md) file for details.
|
|
212
|
-
|
|
213
|
-
## Acknowledgments
|
|
214
|
-
|
|
215
|
-
Many thanks to [Chema Balsas](https://www.npmjs.com/~jbalsas) for giving up the `apify` package name
|
|
216
|
-
on NPM and renaming his project to [jsdocify](https://www.npmjs.com/package/jsdocify).
|
|
158
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE.md](https://github.com/apify/crawlee/blob/master/LICENSE.md) file for details.
|
package/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export const CheerioCrawler = mod.CheerioCrawler;
|
|
|
9
9
|
export const Configuration = mod.Configuration;
|
|
10
10
|
export const CookieParseError = mod.CookieParseError;
|
|
11
11
|
export const CrawlerExtension = mod.CrawlerExtension;
|
|
12
|
+
export const CriticalError = mod.CriticalError;
|
|
12
13
|
export const DATASET_ITERATORS_DEFAULT_LIMIT = mod.DATASET_ITERATORS_DEFAULT_LIMIT;
|
|
13
14
|
export const Dataset = mod.Dataset;
|
|
14
15
|
export const EVENT_SESSION_RETIRED = mod.EVENT_SESSION_RETIRED;
|
|
@@ -23,13 +24,17 @@ export const Logger = mod.Logger;
|
|
|
23
24
|
export const LoggerJson = mod.LoggerJson;
|
|
24
25
|
export const LoggerText = mod.LoggerText;
|
|
25
26
|
export const MAX_QUERIES_FOR_CONSISTENCY = mod.MAX_QUERIES_FOR_CONSISTENCY;
|
|
27
|
+
export const MissingRouteError = mod.MissingRouteError;
|
|
28
|
+
export const NonRetryableError = mod.NonRetryableError;
|
|
26
29
|
export const ProxyConfiguration = mod.ProxyConfiguration;
|
|
30
|
+
export const PseudoUrl = mod.PseudoUrl;
|
|
27
31
|
export const QUERY_HEAD_BUFFER = mod.QUERY_HEAD_BUFFER;
|
|
28
32
|
export const QUERY_HEAD_MIN_LENGTH = mod.QUERY_HEAD_MIN_LENGTH;
|
|
29
33
|
export const REQUESTS_PERSISTENCE_KEY = mod.REQUESTS_PERSISTENCE_KEY;
|
|
30
34
|
export const Request = mod.Request;
|
|
31
35
|
export const RequestList = mod.RequestList;
|
|
32
36
|
export const RequestQueue = mod.RequestQueue;
|
|
37
|
+
export const Router = mod.Router;
|
|
33
38
|
export const STATE_PERSISTENCE_KEY = mod.STATE_PERSISTENCE_KEY;
|
|
34
39
|
export const STATUS_CODES_BLOCKED = mod.STATUS_CODES_BLOCKED;
|
|
35
40
|
export const STORAGE_CONSISTENCY_DELAY_MILLIS = mod.STORAGE_CONSISTENCY_DELAY_MILLIS;
|
|
@@ -45,6 +50,8 @@ export const chunkBySize = mod.chunkBySize;
|
|
|
45
50
|
export const constructGlobObjectsFromGlobs = mod.constructGlobObjectsFromGlobs;
|
|
46
51
|
export const constructRegExpObjectsFromPseudoUrls = mod.constructRegExpObjectsFromPseudoUrls;
|
|
47
52
|
export const constructRegExpObjectsFromRegExps = mod.constructRegExpObjectsFromRegExps;
|
|
53
|
+
export const createBasicRouter = mod.createBasicRouter;
|
|
54
|
+
export const createCheerioRouter = mod.createCheerioRouter;
|
|
48
55
|
export const createDeserialize = mod.createDeserialize;
|
|
49
56
|
export const createRequestOptions = mod.createRequestOptions;
|
|
50
57
|
export const createRequests = mod.createRequests;
|
|
@@ -57,6 +64,7 @@ export const handleRequestTimeout = mod.handleRequestTimeout;
|
|
|
57
64
|
export const log = mod.log;
|
|
58
65
|
export const maybeStringify = mod.maybeStringify;
|
|
59
66
|
export const mergeCookies = mod.mergeCookies;
|
|
67
|
+
export const purgeDefaultStorages = mod.purgeDefaultStorages;
|
|
60
68
|
export const resolveBaseUrl = mod.resolveBaseUrl;
|
|
61
69
|
export const serializeArray = mod.serializeArray;
|
|
62
70
|
export const updateEnqueueLinksPatternCache = mod.updateEnqueueLinksPatternCache;
|