@crawlee/http 4.0.0-beta.253 → 4.0.0-beta.255
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/internals/http-crawler.js +2 -12
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import util from 'node:util';
|
|
3
|
-
import { BasicCrawler, ContextPipeline, getCookiesFromResponse, NavigationSkippedError, remainingNavigationWindowMillis, RequestState, RequestThrottledError, Router, SessionError, } from '@crawlee/basic';
|
|
3
|
+
import { BasicCrawler, ContextPipeline, getCookiesFromResponse, NavigationSkippedError, skippedNavigationRequest, remainingNavigationWindowMillis, RequestState, RequestThrottledError, Router, SessionError, } from '@crawlee/basic';
|
|
4
4
|
import { ResponseWithUrl } from '@crawlee/http-client';
|
|
5
5
|
import { parseArgument, RETRY_CSS_SELECTORS, schemas } from '@crawlee/utils/internal';
|
|
6
6
|
import { isTypeValid, parse as parseContentType } from 'content-type';
|
|
@@ -208,17 +208,7 @@ export class HttpCrawler extends BasicCrawler {
|
|
|
208
208
|
const { request } = crawlingContext;
|
|
209
209
|
if (request.skipNavigation) {
|
|
210
210
|
return {
|
|
211
|
-
request:
|
|
212
|
-
get(target, propertyName) {
|
|
213
|
-
if (propertyName === 'loadedUrl') {
|
|
214
|
-
throw new NavigationSkippedError('The `request.loadedUrl` property is not available - `skipNavigation` was used');
|
|
215
|
-
}
|
|
216
|
-
// `target` as receiver and bound methods, or `#` members throw on the proxy
|
|
217
|
-
const value = Reflect.get(target, propertyName, target);
|
|
218
|
-
return typeof value === 'function' ? value.bind(target) : value;
|
|
219
|
-
},
|
|
220
|
-
set: (target, propertyName, value) => Reflect.set(target, propertyName, value, target),
|
|
221
|
-
}),
|
|
211
|
+
request: skippedNavigationRequest(request),
|
|
222
212
|
get response() {
|
|
223
213
|
throw new NavigationSkippedError('The `response` property is not available - `skipNavigation` was used');
|
|
224
214
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/http",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.255",
|
|
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.13.0"
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@apify/timeout": "^1.0.1",
|
|
51
|
-
"@crawlee/basic": "4.0.0-beta.
|
|
52
|
-
"@crawlee/http-client": "4.0.0-beta.
|
|
53
|
-
"@crawlee/types": "4.0.0-beta.
|
|
54
|
-
"@crawlee/utils": "4.0.0-beta.
|
|
51
|
+
"@crawlee/basic": "4.0.0-beta.255",
|
|
52
|
+
"@crawlee/http-client": "4.0.0-beta.255",
|
|
53
|
+
"@crawlee/types": "4.0.0-beta.255",
|
|
54
|
+
"@crawlee/utils": "4.0.0-beta.255",
|
|
55
55
|
"cheerio": "^1.2.0",
|
|
56
56
|
"content-type": "^3.1.1",
|
|
57
57
|
"domhandler": "^6.0.1",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "e1b2f6c415f90b3eca1686a39a8af5272b54046e"
|
|
72
72
|
}
|