@crawlee/linkedom 4.0.0-beta.17 → 4.0.0-beta.170
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 +14 -14
- package/index.d.ts +1 -1
- package/index.js +0 -1
- package/internals/linkedom-crawler.d.ts +30 -79
- package/internals/linkedom-crawler.js +24 -153
- package/internals/linkedom-parser.d.ts +11 -0
- package/internals/linkedom-parser.js +44 -0
- package/package.json +9 -8
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/internals/linkedom-crawler.d.ts.map +0 -1
- package/internals/linkedom-crawler.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
2
|
<a href="https://crawlee.dev">
|
|
3
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"
|
|
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
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
|
-
<br
|
|
8
|
+
<br />
|
|
9
9
|
<small>A web scraping and browser automation library</small>
|
|
10
10
|
</h1>
|
|
11
11
|
|
|
12
|
-
<p align=center>
|
|
13
|
-
<a href="https://trendshift.io/repositories/5179" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5179" alt="apify%2Fcrawlee | Trendshift"
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://trendshift.io/repositories/5179" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5179" alt="apify%2Fcrawlee | Trendshift" width="250" height="55"/></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<p align=center>
|
|
17
|
-
<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"
|
|
18
|
-
<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"
|
|
19
|
-
<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"
|
|
20
|
-
<a href="https://github.com/apify/crawlee/actions/workflows/test-ci.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-ci.yml/badge.svg?branch=master" alt="Build Status"
|
|
16
|
+
<p align="center">
|
|
17
|
+
<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" /></a>
|
|
18
|
+
<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" /></a>
|
|
19
|
+
<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" /></a>
|
|
20
|
+
<a href="https://github.com/apify/crawlee/actions/workflows/test-ci.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-ci.yml/badge.svg?branch=master" alt="Build Status" /></a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
23
|
Crawlee covers your crawling and scraping end-to-end and **helps you build reliable scrapers. Fast.**
|
|
@@ -89,7 +89,7 @@ By default, Crawlee stores data to `./storage` in the current working directory.
|
|
|
89
89
|
We provide automated beta builds for every merged code change in Crawlee. You can find them in the npm [list of releases](https://www.npmjs.com/package/crawlee?activeTab=versions). If you want to test new features or bug fixes before we release them, feel free to install a beta build like this:
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
npm install crawlee@
|
|
92
|
+
npm install crawlee@next
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
If you also use the [Apify SDK](https://github.com/apify/apify-sdk-js), you need to specify dependency overrides in your `package.json` file so that you don't end up with multiple versions of Crawlee installed:
|
|
@@ -98,9 +98,9 @@ If you also use the [Apify SDK](https://github.com/apify/apify-sdk-js), you need
|
|
|
98
98
|
{
|
|
99
99
|
"overrides": {
|
|
100
100
|
"apify": {
|
|
101
|
-
"@crawlee/core": "
|
|
102
|
-
"@crawlee/types": "
|
|
103
|
-
"@crawlee/utils": "
|
|
101
|
+
"@crawlee/core": "$crawlee",
|
|
102
|
+
"@crawlee/types": "$crawlee",
|
|
103
|
+
"@crawlee/utils": "$crawlee"
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,47 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { CrawlingContext, DOMCrawlingContext, ErrorHandler, GetUserDataFromRequest, HttpCrawlerOptions, InternalHttpHook, RequestHandler, RouterHandler, RouterRoutes, RouteSchemas, RoutesFromSchemas } from '@crawlee/http';
|
|
2
|
+
import { DOMCrawler } from '@crawlee/http';
|
|
3
3
|
import type { Dictionary } from '@crawlee/types';
|
|
4
|
-
import
|
|
4
|
+
import type { LinkeDOMParseResult } from './linkedom-parser.js';
|
|
5
5
|
export type LinkeDOMErrorHandler<UserData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
6
|
-
JSONData extends Dictionary = any
|
|
6
|
+
JSONData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
7
|
+
ContextExtension = Dictionary<never>> = ErrorHandler<CrawlingContext, LinkeDOMCrawlingContext<UserData, JSONData> & ContextExtension>;
|
|
7
8
|
export interface LinkeDOMCrawlerOptions<ContextExtension = Dictionary<never>, ExtendedContext extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext & ContextExtension, UserData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
8
|
-
JSONData extends Dictionary = any
|
|
9
|
-
}
|
|
10
|
-
export interface LinkeDOMCrawlerEnqueueLinksOptions extends Omit<EnqueueLinksOptions, 'urls' | 'requestQueue'> {
|
|
9
|
+
JSONData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
10
|
+
Routes extends Record<keyof Routes, Dictionary> = Record<string, UserData>, StatisticStateExtension extends object = {}> extends HttpCrawlerOptions<LinkeDOMCrawlingContext<UserData, JSONData>, ContextExtension, ExtendedContext, Routes, StatisticStateExtension> {
|
|
11
11
|
}
|
|
12
12
|
export type LinkeDOMHook<UserData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
13
13
|
JSONData extends Dictionary = any> = InternalHttpHook<LinkeDOMCrawlingContext<UserData, JSONData>>;
|
|
14
14
|
export interface LinkeDOMCrawlingContext<UserData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
15
|
-
JSONData extends Dictionary = any> extends
|
|
16
|
-
window: Window;
|
|
17
|
-
document: Document;
|
|
18
|
-
/**
|
|
19
|
-
* Wait for an element matching the selector to appear.
|
|
20
|
-
* Timeout defaults to 5s.
|
|
21
|
-
*
|
|
22
|
-
* **Example usage:**
|
|
23
|
-
* ```ts
|
|
24
|
-
* async requestHandler({ waitForSelector, parseWithCheerio }) {
|
|
25
|
-
* await waitForSelector('article h1');
|
|
26
|
-
* const $ = await parseWithCheerio();
|
|
27
|
-
* const title = $('title').text();
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
waitForSelector(selector: string, timeoutMs?: number): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Returns Cheerio handle, allowing to work with the data same way as with {@link CheerioCrawler}.
|
|
34
|
-
* When provided with the `selector` argument, it will first look for the selector with a 5s timeout.
|
|
35
|
-
*
|
|
36
|
-
* **Example usage:**
|
|
37
|
-
* ```javascript
|
|
38
|
-
* async requestHandler({ parseWithCheerio }) {
|
|
39
|
-
* const $ = await parseWithCheerio();
|
|
40
|
-
* const title = $('title').text();
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
parseWithCheerio(selector?: string, timeoutMs?: number): Promise<CheerioRoot>;
|
|
15
|
+
JSONData extends Dictionary = any> extends DOMCrawlingContext<LinkeDOMParseResult, UserData, JSONData> {
|
|
45
16
|
}
|
|
46
17
|
export type LinkeDOMRequestHandler<UserData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
|
|
47
18
|
JSONData extends Dictionary = any> = RequestHandler<LinkeDOMCrawlingContext<UserData, JSONData>>;
|
|
@@ -64,38 +35,40 @@ JSONData extends Dictionary = any> = RequestHandler<LinkeDOMCrawlingContext<User
|
|
|
64
35
|
* and then invokes the user-provided {@link LinkeDOMCrawlerOptions.requestHandler} to extract page data
|
|
65
36
|
* using the `window` object.
|
|
66
37
|
*
|
|
67
|
-
* The source URLs are represented using {@link Request} objects that are fed from
|
|
68
|
-
* {@link
|
|
69
|
-
*
|
|
38
|
+
* The source URLs are represented using {@link Request} objects that are fed from the
|
|
39
|
+
* {@link IRequestManager|request manager} provided via the {@link LinkeDOMCrawlerOptions.requestManager|`requestManager`}
|
|
40
|
+
* constructor option (a {@link RequestQueue} is itself a request manager). To read from a read-only source such
|
|
41
|
+
* as a {@link RequestList} while still being able to enqueue new requests, combine it with a queue into a
|
|
42
|
+
* {@link RequestManagerTandem} via {@link IRequestLoader.toTandem|`requestLoader.toTandem()`} and pass the
|
|
43
|
+
* result as `requestManager`.
|
|
70
44
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* to {@link RequestQueue} before it starts their processing. This ensures that a single URL is not crawled multiple times.
|
|
45
|
+
* > The {@link LinkeDOMCrawlerOptions.requestList|`requestList`} and {@link LinkeDOMCrawlerOptions.requestQueue|`requestQueue`}
|
|
46
|
+
* > options are deprecated; they are still accepted and folded into a single `requestManager` for back-compat.
|
|
74
47
|
*
|
|
75
48
|
* The crawler finishes when there are no more {@link Request} objects to crawl.
|
|
76
49
|
*
|
|
77
|
-
* We can use the `preNavigationHooks` to adjust
|
|
50
|
+
* We can use the `preNavigationHooks` to adjust the crawling context before the request is made:
|
|
78
51
|
*
|
|
79
52
|
* ```
|
|
80
53
|
* preNavigationHooks: [
|
|
81
|
-
* (crawlingContext
|
|
54
|
+
* (crawlingContext) => {
|
|
82
55
|
* // ...
|
|
83
56
|
* },
|
|
84
57
|
* ]
|
|
85
58
|
* ```
|
|
86
59
|
*
|
|
87
|
-
* By default, `LinkeDOMCrawler` only processes web pages with the `text/html`
|
|
88
|
-
* and `application/
|
|
60
|
+
* By default, `LinkeDOMCrawler` only processes web pages with the `text/html`, `application/xhtml+xml`, `text/xml`, `application/xml`,
|
|
61
|
+
* and `application/json` MIME content types (as reported by the `Content-Type` HTTP header),
|
|
89
62
|
* and skips pages with other content types. If you want the crawler to process other content types,
|
|
90
63
|
* use the {@link LinkeDOMCrawlerOptions.additionalMimeTypes} constructor option.
|
|
91
64
|
* Beware that the parsing behavior differs for HTML, XML, JSON and other types of content.
|
|
92
65
|
* For more details, see {@link LinkeDOMCrawlerOptions.requestHandler}.
|
|
93
66
|
*
|
|
94
|
-
* New requests are only dispatched when there is enough free CPU and memory available,
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* {@link
|
|
67
|
+
* New requests are only dispatched when there is enough free CPU and memory available, as judged by the crawler's
|
|
68
|
+
* {@link ConcurrencySystem}.
|
|
69
|
+
* Concurrency is tuned via the `minConcurrency`, `maxConcurrency` and `maxRequestsPerMinute` options of the
|
|
70
|
+
* `LinkeDOMCrawler` constructor, or, for finer control, by injecting a pre-configured
|
|
71
|
+
* {@link ConcurrencySystem|`concurrencySystem`}.
|
|
99
72
|
*
|
|
100
73
|
* **Example usage:**
|
|
101
74
|
*
|
|
@@ -115,30 +88,9 @@ JSONData extends Dictionary = any> = RequestHandler<LinkeDOMCrawlingContext<User
|
|
|
115
88
|
* ```
|
|
116
89
|
* @category Crawlers
|
|
117
90
|
*/
|
|
118
|
-
export declare class LinkeDOMCrawler<ContextExtension = Dictionary<never>, ExtendedContext extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext & ContextExtension> extends
|
|
119
|
-
|
|
120
|
-
constructor(options: LinkeDOMCrawlerOptions<ContextExtension, ExtendedContext>);
|
|
121
|
-
private parseContent;
|
|
122
|
-
private addHelpers;
|
|
123
|
-
}
|
|
124
|
-
interface EnqueueLinksInternalOptions {
|
|
125
|
-
options?: EnqueueLinksOptions;
|
|
126
|
-
window: Window | null;
|
|
127
|
-
requestQueue: RequestProvider;
|
|
128
|
-
robotsTxtFile?: RobotsTxtFile;
|
|
129
|
-
onSkippedRequest?: SkippedRequestCallback;
|
|
130
|
-
originalRequestUrl: string;
|
|
131
|
-
finalRequestUrl?: string;
|
|
132
|
-
}
|
|
133
|
-
interface BoundEnqueueLinksInternalOptions {
|
|
134
|
-
enqueueLinks: BasicCrawlingContext['enqueueLinks'];
|
|
135
|
-
options?: EnqueueLinksOptions;
|
|
136
|
-
window: Window | null;
|
|
137
|
-
originalRequestUrl: string;
|
|
138
|
-
finalRequestUrl?: string;
|
|
91
|
+
export declare class LinkeDOMCrawler<ContextExtension = Dictionary<never>, ExtendedContext extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<LinkeDOMCrawlingContext['request']>>, StatisticStateExtension extends object = {}> extends DOMCrawler<LinkeDOMParseResult, ContextExtension, ExtendedContext, Routes, StatisticStateExtension> {
|
|
92
|
+
constructor(options?: LinkeDOMCrawlerOptions<ContextExtension, ExtendedContext, any, any, Routes, StatisticStateExtension>);
|
|
139
93
|
}
|
|
140
|
-
/** @internal */
|
|
141
|
-
export declare function linkedomCrawlerEnqueueLinks(options: EnqueueLinksInternalOptions | BoundEnqueueLinksInternalOptions): Promise<unknown>;
|
|
142
94
|
/**
|
|
143
95
|
* Creates new {@link Router} instance that works based on request labels.
|
|
144
96
|
* This instance can then serve as a `requestHandler` of your {@link LinkeDOMCrawler}.
|
|
@@ -163,7 +115,6 @@ export declare function linkedomCrawlerEnqueueLinks(options: EnqueueLinksInterna
|
|
|
163
115
|
* await crawler.run();
|
|
164
116
|
* ```
|
|
165
117
|
*/
|
|
166
|
-
|
|
167
|
-
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, UserData
|
|
168
|
-
export
|
|
169
|
-
//# sourceMappingURL=linkedom-crawler.d.ts.map
|
|
118
|
+
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>>(routes?: RouterRoutes<Context, Routes>): RouterHandler<Context, Routes>;
|
|
119
|
+
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
|
|
120
|
+
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, const Schemas extends RouteSchemas = RouteSchemas>(schemas: Schemas): RouterHandler<Context, RoutesFromSchemas<Schemas>>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import * as cheerio from 'cheerio';
|
|
4
|
-
import { DOMParser } from 'linkedom/cached';
|
|
1
|
+
import { DOMCrawler, Router } from '@crawlee/http';
|
|
2
|
+
import { linkedomParser } from './linkedom-parser.js';
|
|
5
3
|
/**
|
|
6
4
|
* Provides a framework for the parallel crawling of web pages using plain HTTP requests and
|
|
7
5
|
* [linkedom](https://www.npmjs.com/package/linkedom) LinkeDOM implementation.
|
|
@@ -21,38 +19,40 @@ import { DOMParser } from 'linkedom/cached';
|
|
|
21
19
|
* and then invokes the user-provided {@link LinkeDOMCrawlerOptions.requestHandler} to extract page data
|
|
22
20
|
* using the `window` object.
|
|
23
21
|
*
|
|
24
|
-
* The source URLs are represented using {@link Request} objects that are fed from
|
|
25
|
-
* {@link
|
|
26
|
-
*
|
|
22
|
+
* The source URLs are represented using {@link Request} objects that are fed from the
|
|
23
|
+
* {@link IRequestManager|request manager} provided via the {@link LinkeDOMCrawlerOptions.requestManager|`requestManager`}
|
|
24
|
+
* constructor option (a {@link RequestQueue} is itself a request manager). To read from a read-only source such
|
|
25
|
+
* as a {@link RequestList} while still being able to enqueue new requests, combine it with a queue into a
|
|
26
|
+
* {@link RequestManagerTandem} via {@link IRequestLoader.toTandem|`requestLoader.toTandem()`} and pass the
|
|
27
|
+
* result as `requestManager`.
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* to {@link RequestQueue} before it starts their processing. This ensures that a single URL is not crawled multiple times.
|
|
29
|
+
* > The {@link LinkeDOMCrawlerOptions.requestList|`requestList`} and {@link LinkeDOMCrawlerOptions.requestQueue|`requestQueue`}
|
|
30
|
+
* > options are deprecated; they are still accepted and folded into a single `requestManager` for back-compat.
|
|
31
31
|
*
|
|
32
32
|
* The crawler finishes when there are no more {@link Request} objects to crawl.
|
|
33
33
|
*
|
|
34
|
-
* We can use the `preNavigationHooks` to adjust
|
|
34
|
+
* We can use the `preNavigationHooks` to adjust the crawling context before the request is made:
|
|
35
35
|
*
|
|
36
36
|
* ```
|
|
37
37
|
* preNavigationHooks: [
|
|
38
|
-
* (crawlingContext
|
|
38
|
+
* (crawlingContext) => {
|
|
39
39
|
* // ...
|
|
40
40
|
* },
|
|
41
41
|
* ]
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
|
-
* By default, `LinkeDOMCrawler` only processes web pages with the `text/html`
|
|
45
|
-
* and `application/
|
|
44
|
+
* By default, `LinkeDOMCrawler` only processes web pages with the `text/html`, `application/xhtml+xml`, `text/xml`, `application/xml`,
|
|
45
|
+
* and `application/json` MIME content types (as reported by the `Content-Type` HTTP header),
|
|
46
46
|
* and skips pages with other content types. If you want the crawler to process other content types,
|
|
47
47
|
* use the {@link LinkeDOMCrawlerOptions.additionalMimeTypes} constructor option.
|
|
48
48
|
* Beware that the parsing behavior differs for HTML, XML, JSON and other types of content.
|
|
49
49
|
* For more details, see {@link LinkeDOMCrawlerOptions.requestHandler}.
|
|
50
50
|
*
|
|
51
|
-
* New requests are only dispatched when there is enough free CPU and memory available,
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* {@link
|
|
51
|
+
* New requests are only dispatched when there is enough free CPU and memory available, as judged by the crawler's
|
|
52
|
+
* {@link ConcurrencySystem}.
|
|
53
|
+
* Concurrency is tuned via the `minConcurrency`, `maxConcurrency` and `maxRequestsPerMinute` options of the
|
|
54
|
+
* `LinkeDOMCrawler` constructor, or, for finer control, by injecting a pre-configured
|
|
55
|
+
* {@link ConcurrencySystem|`concurrencySystem`}.
|
|
56
56
|
*
|
|
57
57
|
* **Example usage:**
|
|
58
58
|
*
|
|
@@ -72,140 +72,11 @@ import { DOMParser } from 'linkedom/cached';
|
|
|
72
72
|
* ```
|
|
73
73
|
* @category Crawlers
|
|
74
74
|
*/
|
|
75
|
-
export class LinkeDOMCrawler extends
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
super({
|
|
79
|
-
...options,
|
|
80
|
-
contextPipelineBuilder: () => this.buildContextPipeline()
|
|
81
|
-
.compose({
|
|
82
|
-
action: async (context) => this.parseContent(context),
|
|
83
|
-
})
|
|
84
|
-
.compose({ action: async (context) => this.addHelpers(context) }),
|
|
85
|
-
});
|
|
75
|
+
export class LinkeDOMCrawler extends DOMCrawler {
|
|
76
|
+
constructor(options = {}) {
|
|
77
|
+
super({ ...options, parser: linkedomParser() });
|
|
86
78
|
}
|
|
87
|
-
async parseContent(crawlingContext) {
|
|
88
|
-
const isXml = crawlingContext.contentType.type.includes('xml');
|
|
89
|
-
const document = LinkeDOMCrawler.parser.parseFromString(crawlingContext.body.toString(), isXml ? 'text/xml' : 'text/html');
|
|
90
|
-
return {
|
|
91
|
-
window: document.defaultView,
|
|
92
|
-
get body() {
|
|
93
|
-
return document.documentElement.outerHTML;
|
|
94
|
-
},
|
|
95
|
-
get document() {
|
|
96
|
-
// See comment about typing in LinkeDOMCrawlingContext definition
|
|
97
|
-
return document;
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
async addHelpers(crawlingContext) {
|
|
102
|
-
return {
|
|
103
|
-
enqueueLinks: async (enqueueOptions) => {
|
|
104
|
-
return linkedomCrawlerEnqueueLinks({
|
|
105
|
-
options: { ...enqueueOptions, limit: this.calculateEnqueuedRequestLimit(enqueueOptions?.limit) },
|
|
106
|
-
window: document.defaultView,
|
|
107
|
-
requestQueue: await this.getRequestQueue(),
|
|
108
|
-
robotsTxtFile: await this.getRobotsTxtFileForUrl(crawlingContext.request.url),
|
|
109
|
-
onSkippedRequest: this.handleSkippedRequest,
|
|
110
|
-
originalRequestUrl: crawlingContext.request.url,
|
|
111
|
-
finalRequestUrl: crawlingContext.request.loadedUrl,
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
async waitForSelector(selector, timeoutMs = 5_000) {
|
|
115
|
-
const $ = cheerio.load(crawlingContext.body);
|
|
116
|
-
if ($(selector).get().length === 0) {
|
|
117
|
-
if (timeoutMs) {
|
|
118
|
-
await sleep(50);
|
|
119
|
-
await this.waitForSelector(selector, Math.max(timeoutMs - 50, 0));
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
throw new Error(`Selector '${selector}' not found.`);
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
async parseWithCheerio(selector, _timeoutMs = 5_000) {
|
|
126
|
-
const $ = cheerio.load(crawlingContext.body);
|
|
127
|
-
if (selector && $(selector).get().length === 0) {
|
|
128
|
-
throw new Error(`Selector '${selector}' not found.`);
|
|
129
|
-
}
|
|
130
|
-
return $;
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/** @internal */
|
|
136
|
-
function containsEnqueueLinks(options) {
|
|
137
|
-
return !!options.enqueueLinks;
|
|
138
|
-
}
|
|
139
|
-
/** @internal */
|
|
140
|
-
export async function linkedomCrawlerEnqueueLinks(options) {
|
|
141
|
-
const { options: enqueueLinksOptions, window, originalRequestUrl, finalRequestUrl } = options;
|
|
142
|
-
if (!window) {
|
|
143
|
-
throw new Error('Cannot enqueue links because the DOM is not available.');
|
|
144
|
-
}
|
|
145
|
-
const baseUrl = resolveBaseUrlForEnqueueLinksFiltering({
|
|
146
|
-
enqueueStrategy: enqueueLinksOptions?.strategy,
|
|
147
|
-
finalRequestUrl,
|
|
148
|
-
originalRequestUrl,
|
|
149
|
-
userProvidedBaseUrl: enqueueLinksOptions?.baseUrl,
|
|
150
|
-
});
|
|
151
|
-
const urls = extractUrlsFromWindow(window, enqueueLinksOptions?.selector ?? 'a', enqueueLinksOptions?.baseUrl ?? finalRequestUrl ?? originalRequestUrl);
|
|
152
|
-
if (containsEnqueueLinks(options)) {
|
|
153
|
-
return options.enqueueLinks({
|
|
154
|
-
urls,
|
|
155
|
-
baseUrl,
|
|
156
|
-
...enqueueLinksOptions,
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
return enqueueLinks({
|
|
160
|
-
requestQueue: options.requestQueue,
|
|
161
|
-
robotsTxtFile: options.robotsTxtFile,
|
|
162
|
-
onSkippedRequest: options.onSkippedRequest,
|
|
163
|
-
urls,
|
|
164
|
-
baseUrl,
|
|
165
|
-
...enqueueLinksOptions,
|
|
166
|
-
});
|
|
167
79
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
* @ignore
|
|
171
|
-
*/
|
|
172
|
-
function extractUrlsFromWindow(window, selector, baseUrl) {
|
|
173
|
-
return Array.from(window.document.querySelectorAll(selector))
|
|
174
|
-
.map((e) => e.href)
|
|
175
|
-
.filter((href) => href !== undefined && href !== '')
|
|
176
|
-
.map((href) => {
|
|
177
|
-
if (href === undefined) {
|
|
178
|
-
return undefined;
|
|
179
|
-
}
|
|
180
|
-
return tryAbsoluteURL(href, baseUrl);
|
|
181
|
-
})
|
|
182
|
-
.filter((href) => href !== undefined && href !== '');
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Creates new {@link Router} instance that works based on request labels.
|
|
186
|
-
* This instance can then serve as a `requestHandler` of your {@link LinkeDOMCrawler}.
|
|
187
|
-
* Defaults to the {@link LinkeDOMCrawlingContext}.
|
|
188
|
-
*
|
|
189
|
-
* > Serves as a shortcut for using `Router.create<LinkeDOMCrawlingContext>()`.
|
|
190
|
-
*
|
|
191
|
-
* ```ts
|
|
192
|
-
* import { LinkeDOMCrawler, createLinkeDOMRouter } from 'crawlee';
|
|
193
|
-
*
|
|
194
|
-
* const router = createLinkeDOMRouter();
|
|
195
|
-
* router.addHandler('label-a', async (ctx) => {
|
|
196
|
-
* ctx.log.info('...');
|
|
197
|
-
* });
|
|
198
|
-
* router.addDefaultHandler(async (ctx) => {
|
|
199
|
-
* ctx.log.info('...');
|
|
200
|
-
* });
|
|
201
|
-
*
|
|
202
|
-
* const crawler = new LinkeDOMCrawler({
|
|
203
|
-
* requestHandler: router,
|
|
204
|
-
* });
|
|
205
|
-
* await crawler.run();
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
export function createLinkeDOMRouter(routes) {
|
|
209
|
-
return Router.create(routes);
|
|
80
|
+
export function createLinkeDOMRouter(routesOrSchemas) {
|
|
81
|
+
return Router.create(routesOrSchemas);
|
|
210
82
|
}
|
|
211
|
-
//# sourceMappingURL=linkedom-crawler.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DOMParser } from '@crawlee/http';
|
|
2
|
+
export interface LinkeDOMParseResult {
|
|
3
|
+
window: Window;
|
|
4
|
+
document: Document;
|
|
5
|
+
body: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A {@link DOMParser} backed by [linkedom](https://www.npmjs.com/package/linkedom). Pass it to a
|
|
9
|
+
* {@link DOMCrawler} to get the crawling context {@link LinkeDOMCrawler} provides.
|
|
10
|
+
*/
|
|
11
|
+
export declare function linkedomParser(): DOMParser<LinkeDOMParseResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { tryAbsoluteURL } from '@crawlee/utils/internal';
|
|
2
|
+
import { DOMParser as LinkeDOMParser } from 'linkedom/cached';
|
|
3
|
+
/**
|
|
4
|
+
* A {@link DOMParser} backed by [linkedom](https://www.npmjs.com/package/linkedom). Pass it to a
|
|
5
|
+
* {@link DOMCrawler} to get the crawling context {@link LinkeDOMCrawler} provides.
|
|
6
|
+
*/
|
|
7
|
+
export function linkedomParser() {
|
|
8
|
+
const parser = new LinkeDOMParser();
|
|
9
|
+
return {
|
|
10
|
+
placeholderMembers: { window: true, document: true, body: true },
|
|
11
|
+
parse(context) {
|
|
12
|
+
const isXml = context.contentType.type.includes('xml');
|
|
13
|
+
const document = parser.parseFromString(context.body.toString(), isXml ? 'text/xml' : 'text/html');
|
|
14
|
+
return {
|
|
15
|
+
window: document.defaultView,
|
|
16
|
+
get body() {
|
|
17
|
+
return document.documentElement.outerHTML;
|
|
18
|
+
},
|
|
19
|
+
get document() {
|
|
20
|
+
// See comment about typing in LinkeDOMParseResult definition
|
|
21
|
+
return document;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
extractLinks: ({ window }, selector, baseUrl) => extractUrlsFromWindow(window, selector, baseUrl),
|
|
26
|
+
select: ({ document }, selector) => document.querySelectorAll(selector),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Extracts URLs from a given Window object.
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
function extractUrlsFromWindow(window, selector, baseUrl) {
|
|
34
|
+
return Array.from(window.document.querySelectorAll(selector))
|
|
35
|
+
.map((e) => e.href)
|
|
36
|
+
.filter((href) => href !== undefined && href !== '')
|
|
37
|
+
.map((href) => {
|
|
38
|
+
if (href === undefined) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return tryAbsoluteURL(href, baseUrl);
|
|
42
|
+
})
|
|
43
|
+
.filter((href) => href !== undefined && href !== '');
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/linkedom",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.170",
|
|
4
4
|
"description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://crawlee.dev",
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "
|
|
41
|
+
"build": "pnpm clean && pnpm compile && pnpm copy",
|
|
42
42
|
"clean": "rimraf ./dist",
|
|
43
43
|
"compile": "tsc -p tsconfig.build.json",
|
|
44
44
|
"copy": "tsx ../../scripts/copy.ts"
|
|
@@ -47,12 +47,13 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@apify/timeout": "^0.
|
|
51
|
-
"@apify/utilities": "^
|
|
52
|
-
"@crawlee/http": "4.0.0-beta.
|
|
53
|
-
"@crawlee/types": "4.0.0-beta.
|
|
50
|
+
"@apify/timeout": "^1.0.1",
|
|
51
|
+
"@apify/utilities": "^3.0.1",
|
|
52
|
+
"@crawlee/http": "4.0.0-beta.170",
|
|
53
|
+
"@crawlee/types": "4.0.0-beta.170",
|
|
54
|
+
"@crawlee/utils": "4.0.0-beta.170",
|
|
55
|
+
"cheerio": "^1.0.0",
|
|
54
56
|
"linkedom": "^0.18.10",
|
|
55
|
-
"ow": "^2.0.0",
|
|
56
57
|
"tslib": "^2.8.1"
|
|
57
58
|
},
|
|
58
59
|
"lerna": {
|
|
@@ -62,5 +63,5 @@
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "86e1c891da983125e9e18f1a2327fbcf5e0f5fc2"
|
|
66
67
|
}
|
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkedom-crawler.d.ts","sourceRoot":"","sources":["../../src/internals/linkedom-crawler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,Y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