@crawlee/http 4.0.0-beta.254 → 4.0.0-beta.256

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.
@@ -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: new Proxy(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.254",
3
+ "version": "4.0.0-beta.256",
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.254",
52
- "@crawlee/http-client": "4.0.0-beta.254",
53
- "@crawlee/types": "4.0.0-beta.254",
54
- "@crawlee/utils": "4.0.0-beta.254",
51
+ "@crawlee/basic": "4.0.0-beta.256",
52
+ "@crawlee/http-client": "4.0.0-beta.256",
53
+ "@crawlee/types": "4.0.0-beta.256",
54
+ "@crawlee/utils": "4.0.0-beta.256",
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": "fd5e81ed20e33a43a281602f76be93169980bcd5"
71
+ "gitHead": "06cbfcc77b373a93f1a6a048e8115433db98c862"
72
72
  }