@crawlee/http-client 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.
- package/base-http-client.d.ts +1 -1
- package/base-http-client.js +4 -4
- package/package.json +3 -3
package/base-http-client.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface CustomFetchOptions {
|
|
|
32
32
|
* implement only the low-level network call in `fetch`.
|
|
33
33
|
*/
|
|
34
34
|
export declare abstract class BaseHttpClient implements BaseHttpClientInterface {
|
|
35
|
-
private
|
|
35
|
+
#private;
|
|
36
36
|
constructor(options?: {
|
|
37
37
|
logger?: CrawleeLogger;
|
|
38
38
|
});
|
package/base-http-client.js
CHANGED
|
@@ -5,9 +5,9 @@ import { CookieJar } from 'tough-cookie';
|
|
|
5
5
|
* implement only the low-level network call in `fetch`.
|
|
6
6
|
*/
|
|
7
7
|
export class BaseHttpClient {
|
|
8
|
-
log;
|
|
8
|
+
#log;
|
|
9
9
|
constructor(options) {
|
|
10
|
-
this
|
|
10
|
+
this.#log = options?.logger;
|
|
11
11
|
}
|
|
12
12
|
async applyCookies(request, cookieJar) {
|
|
13
13
|
try {
|
|
@@ -33,7 +33,7 @@ export class BaseHttpClient {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
36
|
-
this
|
|
36
|
+
this.#log?.warning(`Failed to get cookies for URL "${request.url}": ${e.message}`);
|
|
37
37
|
}
|
|
38
38
|
return request;
|
|
39
39
|
}
|
|
@@ -44,7 +44,7 @@ export class BaseHttpClient {
|
|
|
44
44
|
await cookieJar.setCookie(header, response.url);
|
|
45
45
|
}
|
|
46
46
|
catch (e) {
|
|
47
|
-
this
|
|
47
|
+
this.#log?.warning(`Failed to set cookie for URL "${response.url}": ${e.message}`);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/http-client",
|
|
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"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@crawlee/types": "4.0.0-beta.
|
|
50
|
+
"@crawlee/types": "4.0.0-beta.106",
|
|
51
51
|
"tough-cookie": "^6.0.0"
|
|
52
52
|
},
|
|
53
53
|
"lerna": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "38186ba9ec1ab456b6c71ef9a9d45e675a9cd1e5"
|
|
61
61
|
}
|