@crawlee/linkedom 3.18.1-beta.8 → 3.18.1
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.
|
@@ -84,6 +84,7 @@ class LinkeDOMCrawler extends http_1.HttpCrawler {
|
|
|
84
84
|
async _parseHTML(response, isXml, crawlingContext) {
|
|
85
85
|
const body = await (0, utilities_1.concatStreamToBuffer)(response);
|
|
86
86
|
const document = LinkeDOMCrawler.parser.parseFromString(body.toString(), isXml ? 'text/xml' : 'text/html');
|
|
87
|
+
const originalEnqueueLinks = crawlingContext.enqueueLinks;
|
|
87
88
|
return {
|
|
88
89
|
window: document.defaultView,
|
|
89
90
|
get body() {
|
|
@@ -95,13 +96,16 @@ class LinkeDOMCrawler extends http_1.HttpCrawler {
|
|
|
95
96
|
},
|
|
96
97
|
enqueueLinks: async (enqueueOptions) => {
|
|
97
98
|
return linkedomCrawlerEnqueueLinks({
|
|
98
|
-
|
|
99
|
+
// `originalEnqueueLinks` clamps `limit` by the remaining `maxRequestsPerCrawl` budget itself;
|
|
100
|
+
// pre-clamping it here would make the crawler log the internal limit as a user-provided one
|
|
101
|
+
options: enqueueOptions,
|
|
99
102
|
window: document.defaultView,
|
|
100
103
|
requestQueue: await this.getRequestQueue(),
|
|
101
104
|
robotsTxtFile: await this.getRobotsTxtFileForUrl(crawlingContext.request.url),
|
|
102
105
|
onSkippedRequest: this.handleSkippedRequest,
|
|
103
106
|
originalRequestUrl: crawlingContext.request.url,
|
|
104
107
|
finalRequestUrl: crawlingContext.request.loadedUrl,
|
|
108
|
+
enqueueLinks: originalEnqueueLinks,
|
|
105
109
|
});
|
|
106
110
|
},
|
|
107
111
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/linkedom",
|
|
3
|
-
"version": "3.18.1
|
|
3
|
+
"version": "3.18.1",
|
|
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": ">=16.0.0"
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@apify/timeout": "^0.4.0",
|
|
57
57
|
"@apify/utilities": "^2.7.10",
|
|
58
|
-
"@crawlee/http": "3.18.1
|
|
59
|
-
"@crawlee/types": "3.18.1
|
|
60
|
-
"@crawlee/utils": "3.18.1
|
|
58
|
+
"@crawlee/http": "3.18.1",
|
|
59
|
+
"@crawlee/types": "3.18.1",
|
|
60
|
+
"@crawlee/utils": "3.18.1",
|
|
61
61
|
"cheerio": "1.0.0-rc.12",
|
|
62
62
|
"linkedom": "^0.18.0",
|
|
63
63
|
"ow": "^0.28.2",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "5dbdf0e0095235cf9128dbf0a34613f4cca5ce74"
|
|
74
74
|
}
|