@crawlee/linkedom 4.0.0-beta.105 → 4.0.0-beta.106
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.
|
@@ -121,7 +121,7 @@ JSONData extends Dictionary = any> = RequestHandler<LinkeDOMCrawlingContext<User
|
|
|
121
121
|
* @category Crawlers
|
|
122
122
|
*/
|
|
123
123
|
export declare class LinkeDOMCrawler<ContextExtension = Dictionary<never>, ExtendedContext extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<LinkeDOMCrawlingContext['request']>>> extends HttpCrawler<LinkeDOMCrawlingContext, ContextExtension, ExtendedContext, Routes> {
|
|
124
|
-
private
|
|
124
|
+
#private;
|
|
125
125
|
constructor(options: LinkeDOMCrawlerOptions<ContextExtension, ExtendedContext, any, any, Routes>);
|
|
126
126
|
// @ts-ignore optional peer dependency or compatibility with es2022
|
|
127
127
|
protected buildContextPipeline(): import("@crawlee/http").ContextPipeline<CrawlingContext<Dictionary>, InternalHttpCrawlingContext<any, any> & {
|
|
@@ -75,7 +75,7 @@ import { DOMParser } from 'linkedom/cached';
|
|
|
75
75
|
* @category Crawlers
|
|
76
76
|
*/
|
|
77
77
|
export class LinkeDOMCrawler extends HttpCrawler {
|
|
78
|
-
static parser = new DOMParser();
|
|
78
|
+
static #parser = new DOMParser();
|
|
79
79
|
constructor(options) {
|
|
80
80
|
const { contextPipelineBuilder, ...rest } = options;
|
|
81
81
|
super({
|
|
@@ -94,7 +94,7 @@ export class LinkeDOMCrawler extends HttpCrawler {
|
|
|
94
94
|
async parseContent(crawlingContext) {
|
|
95
95
|
try {
|
|
96
96
|
const isXml = crawlingContext.contentType.type.includes('xml');
|
|
97
|
-
const document = LinkeDOMCrawler
|
|
97
|
+
const document = LinkeDOMCrawler.#parser.parseFromString(crawlingContext.body.toString(), isXml ? 'text/xml' : 'text/html');
|
|
98
98
|
return {
|
|
99
99
|
window: document.defaultView,
|
|
100
100
|
get body() {
|
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.106",
|
|
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"
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@apify/timeout": "^0.4.4",
|
|
51
51
|
"@apify/utilities": "^2.15.5",
|
|
52
|
-
"@crawlee/http": "4.0.0-beta.
|
|
53
|
-
"@crawlee/types": "4.0.0-beta.
|
|
54
|
-
"@crawlee/utils": "4.0.0-beta.
|
|
52
|
+
"@crawlee/http": "4.0.0-beta.106",
|
|
53
|
+
"@crawlee/types": "4.0.0-beta.106",
|
|
54
|
+
"@crawlee/utils": "4.0.0-beta.106",
|
|
55
55
|
"cheerio": "^1.0.0",
|
|
56
56
|
"linkedom": "^0.18.10",
|
|
57
57
|
"ow": "^2.0.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "c622f1fc65e65221ea245817c58ecc0ffb4a5cb0"
|
|
68
68
|
}
|