scrapfly-sdk 0.12.1 → 0.12.2
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/README.md +28 -33
- package/esm/crawlerconfig.d.ts +5 -13
- package/esm/crawlerconfig.d.ts.map +1 -1
- package/esm/crawlerconfig.js +1 -4
- package/esm/main.d.ts +2 -2
- package/esm/main.js +2 -2
- package/esm/result.d.ts +8 -8
- package/esm/result.d.ts.map +1 -1
- package/esm/scrapeconfig.d.ts +12 -28
- package/esm/scrapeconfig.d.ts.map +1 -1
- package/esm/scrapeconfig.js +21 -31
- package/esm/screenshotconfig.d.ts +3 -4
- package/esm/screenshotconfig.d.ts.map +1 -1
- package/esm/screenshotconfig.js +1 -1
- package/package.json +1 -1
- package/script/crawlerconfig.d.ts +5 -13
- package/script/crawlerconfig.d.ts.map +1 -1
- package/script/crawlerconfig.js +1 -4
- package/script/main.d.ts +2 -2
- package/script/main.js +2 -2
- package/script/result.d.ts +8 -8
- package/script/result.d.ts.map +1 -1
- package/script/scrapeconfig.d.ts +12 -28
- package/script/scrapeconfig.d.ts.map +1 -1
- package/script/scrapeconfig.js +21 -31
- package/script/screenshotconfig.d.ts +3 -4
- package/script/screenshotconfig.d.ts.map +1 -1
- package/script/screenshotconfig.js +1 -1
- package/src/crawlerconfig.ts +5 -13
- package/src/main.ts +2 -2
- package/src/result.ts +4 -8
- package/src/scrapeconfig.ts +17 -37
- package/src/screenshotconfig.ts +3 -4
package/script/crawlerconfig.js
CHANGED
|
@@ -230,7 +230,7 @@ class CrawlerConfig {
|
|
|
230
230
|
* Storage for the anti-bot bypass toggle, under its deprecated name.
|
|
231
231
|
* `unblocker` is an accessor over this same field — see below.
|
|
232
232
|
*
|
|
233
|
-
* @deprecated Use
|
|
233
|
+
* @deprecated Use {@link CrawlerConfig.unblocker}. `asp` keeps working forever.
|
|
234
234
|
*/
|
|
235
235
|
Object.defineProperty(this, "asp", {
|
|
236
236
|
enumerable: true,
|
|
@@ -384,9 +384,6 @@ class CrawlerConfig {
|
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
386
386
|
* The Unblocker toggle, the current name for what used to be `asp`.
|
|
387
|
-
* Deprecated: use `proxy_pool` (`'unblocker_ultra'` for the Unblocker). The
|
|
388
|
-
* migration guide covers requests written before the proxy pools:
|
|
389
|
-
* https://scrapfly.io/new-pricing#legacy-spellings
|
|
390
387
|
*
|
|
391
388
|
* An accessor over the single `asp` field rather than a second stored
|
|
392
389
|
* property: one storage slot means the two names can never disagree, and
|
package/script/main.d.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* const client = new ScrapflyClient({ key: 'your-api-key' });
|
|
14
14
|
* const result = await client.scrape(new ScrapeConfig({
|
|
15
15
|
* url: 'https://web-scraping.dev/products',
|
|
16
|
-
*
|
|
16
|
+
* unblocker: true,
|
|
17
17
|
* }));
|
|
18
|
-
* console.log(result.content);
|
|
18
|
+
* console.log(result.result.content);
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* See the [Scrapfly docs](https://scrapfly.io/docs) for the full API
|
package/script/main.js
CHANGED
|
@@ -39,9 +39,9 @@ exports.verifySignature = exports.ResourceType = exports.createServer = exports.
|
|
|
39
39
|
* const client = new ScrapflyClient({ key: 'your-api-key' });
|
|
40
40
|
* const result = await client.scrape(new ScrapeConfig({
|
|
41
41
|
* url: 'https://web-scraping.dev/products',
|
|
42
|
-
*
|
|
42
|
+
* unblocker: true,
|
|
43
43
|
* }));
|
|
44
|
-
* console.log(result.content);
|
|
44
|
+
* console.log(result.result.content);
|
|
45
45
|
* ```
|
|
46
46
|
*
|
|
47
47
|
* See the [Scrapfly docs](https://scrapfly.io/docs) for the full API
|
package/script/result.d.ts
CHANGED
|
@@ -14,13 +14,7 @@ export type ConfigData = {
|
|
|
14
14
|
debug: boolean;
|
|
15
15
|
raise_on_upstream_error: boolean;
|
|
16
16
|
cache_ttl: number;
|
|
17
|
-
/**
|
|
18
|
-
* The pool the request asked for, the way the account reads it: Tor reads `public_tor_pool` and one of the
|
|
19
|
-
* account's own pools its name. Otherwise, when the Unblocker ran (asked, or forced by a target that requires
|
|
20
|
-
* it), `basic` and `unblocker` read `unblocker` and any other pool `unblocker_ultra`. Without the Unblocker a
|
|
21
|
-
* Scrapfly pool reads by its network (`basic`, `unblocker`, `mobile`, `isp`) and any other name as sent.
|
|
22
|
-
* `context.proxy.pool` reads the same.
|
|
23
|
-
*/
|
|
17
|
+
/** The proxy pool the request ran on. */
|
|
24
18
|
proxy_pool: string;
|
|
25
19
|
session?: string;
|
|
26
20
|
tags: Set<string>;
|
|
@@ -81,7 +75,7 @@ export type ContextData = {
|
|
|
81
75
|
country: string;
|
|
82
76
|
identity: string;
|
|
83
77
|
network: string;
|
|
84
|
-
/** The
|
|
78
|
+
/** The proxy pool the request ran on. */
|
|
85
79
|
pool: string;
|
|
86
80
|
};
|
|
87
81
|
redirects: Array<string>;
|
|
@@ -165,6 +159,12 @@ export type ResultData = {
|
|
|
165
159
|
retryable: boolean;
|
|
166
160
|
doc_url?: string;
|
|
167
161
|
};
|
|
162
|
+
/** Present when the scrape ran an extraction (`extraction_model`, `extraction_prompt` or a template). */
|
|
163
|
+
extracted_data?: {
|
|
164
|
+
data: any;
|
|
165
|
+
content_type: string;
|
|
166
|
+
data_quality?: any;
|
|
167
|
+
} | null;
|
|
168
168
|
format: string;
|
|
169
169
|
iframes: Array<{
|
|
170
170
|
url: string;
|
package/script/result.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,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EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;CAKpF"}
|
package/script/scrapeconfig.d.ts
CHANGED
|
@@ -51,30 +51,21 @@ type ScrapeConfigOptions = {
|
|
|
51
51
|
* The Unblocker (anti-bot bypass), the current name for what used to be
|
|
52
52
|
* called `asp`. Sent to the API as the `asp` query parameter; only the
|
|
53
53
|
* SDK-facing name changed.
|
|
54
|
-
*
|
|
55
|
-
* @deprecated Use `proxy_pool` (`ScrapeConfig.UNBLOCKER_ULTRA` for the
|
|
56
|
-
* Unblocker). The migration guide covers requests written before the proxy
|
|
57
|
-
* pools: https://scrapfly.io/new-pricing#legacy-spellings
|
|
58
54
|
*/
|
|
59
55
|
unblocker?: boolean;
|
|
60
56
|
/**
|
|
61
|
-
* @deprecated
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* `unblocker`.
|
|
57
|
+
* @deprecated Use {@link unblocker}. `asp` is a permanently supported alias
|
|
58
|
+
* and keeps working forever. When both are supplied `asp` wins, so existing
|
|
59
|
+
* code cannot have its meaning changed by a later `unblocker`.
|
|
65
60
|
*/
|
|
66
61
|
asp?: boolean;
|
|
67
62
|
debug?: boolean;
|
|
68
63
|
raise_on_upstream_error?: boolean;
|
|
69
64
|
cache_ttl?: number;
|
|
70
65
|
/**
|
|
71
|
-
* Proxy pool: `
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* anti-bot protections that have a price of their own: they refuse `basic`
|
|
75
|
-
* and `unblocker` with `ERR::PROXY::UNBLOCKER_ULTRA_REQUIRED`) or `auto`
|
|
76
|
-
* (the API picks the pool from the target's profile), see
|
|
77
|
-
* {@link ScrapeConfig.BASIC}. Each sets the Unblocker itself.
|
|
66
|
+
* Proxy pool: `ScrapeConfig.PUBLIC_DATACENTER_POOL` (the default),
|
|
67
|
+
* `ScrapeConfig.PUBLIC_RESIDENTIAL_POOL` or `ScrapeConfig.PUBLIC_TOR_POOL`.
|
|
68
|
+
* The anti-bot bypass is a parameter of its own: {@link unblocker}.
|
|
78
69
|
*/
|
|
79
70
|
proxy_pool?: string;
|
|
80
71
|
session?: string;
|
|
@@ -127,13 +118,13 @@ type ScrapeConfigOptions = {
|
|
|
127
118
|
geolocation?: string;
|
|
128
119
|
};
|
|
129
120
|
export declare class ScrapeConfig {
|
|
121
|
+
static PUBLIC_DATACENTER_POOL: string;
|
|
122
|
+
static PUBLIC_RESIDENTIAL_POOL: string;
|
|
123
|
+
static PUBLIC_TOR_POOL: string;
|
|
130
124
|
static BASIC: string;
|
|
131
125
|
static UNBLOCKER: string;
|
|
132
126
|
static UNBLOCKER_ULTRA: string;
|
|
133
127
|
static AUTO: string;
|
|
134
|
-
static PUBLIC_TOR_POOL: string;
|
|
135
|
-
static PUBLIC_DATACENTER_POOL: string;
|
|
136
|
-
static PUBLIC_RESIDENTIAL_POOL: string;
|
|
137
128
|
url: string;
|
|
138
129
|
retry: boolean;
|
|
139
130
|
method: HttpMethod;
|
|
@@ -148,19 +139,15 @@ export declare class ScrapeConfig {
|
|
|
148
139
|
* Storage for the anti-bot bypass toggle, under its deprecated name.
|
|
149
140
|
* `unblocker` is an accessor over this same field — see below.
|
|
150
141
|
*
|
|
151
|
-
* @deprecated Use
|
|
142
|
+
* @deprecated Use {@link ScrapeConfig.unblocker}. `asp` keeps working forever.
|
|
152
143
|
*/
|
|
153
144
|
asp: boolean;
|
|
154
145
|
debug: boolean;
|
|
155
146
|
raise_on_upstream_error: boolean;
|
|
156
147
|
cache_ttl?: number;
|
|
157
148
|
/**
|
|
158
|
-
* Proxy pool: `
|
|
159
|
-
*
|
|
160
|
-
* proxies and the Unblocker, the only pool accepted by the targets and
|
|
161
|
-
* anti-bot protections that have a price of their own) or `auto` (the API
|
|
162
|
-
* picks the pool from the target's profile), see {@link ScrapeConfig.BASIC}.
|
|
163
|
-
* Each sets the Unblocker itself.
|
|
149
|
+
* Proxy pool: `ScrapeConfig.PUBLIC_DATACENTER_POOL` (the default),
|
|
150
|
+
* `ScrapeConfig.PUBLIC_RESIDENTIAL_POOL` or `ScrapeConfig.PUBLIC_TOR_POOL`.
|
|
164
151
|
*/
|
|
165
152
|
proxy_pool?: string;
|
|
166
153
|
session?: string;
|
|
@@ -195,9 +182,6 @@ export declare class ScrapeConfig {
|
|
|
195
182
|
constructor(options: ScrapeConfigOptions);
|
|
196
183
|
/**
|
|
197
184
|
* The Unblocker toggle, the current name for what used to be `asp`.
|
|
198
|
-
* Deprecated: use `proxy_pool` (`ScrapeConfig.UNBLOCKER_ULTRA` for the
|
|
199
|
-
* Unblocker). The migration guide covers requests written before the proxy
|
|
200
|
-
* pools: https://scrapfly.io/new-pricing#legacy-spellings
|
|
201
185
|
*
|
|
202
186
|
* An accessor over the single `asp` field rather than a second stored
|
|
203
187
|
* property: one storage slot means the two names can never disagree, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrapeconfig.d.ts","sourceRoot":"","sources":["../src/scrapeconfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGlD,oBAAY,eAAe;IACzB;;;;;;;QAOI;IACJ,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;CAC9B;AAED,uDAAuD;AACvD,oBAAY,MAAM;IAChB,uBAAuB;IACvB,IAAI,SAAS;IACb,uCAAuC;IACvC,IAAI,SAAS;IACb,sCAAsC;IACtC,QAAQ,aAAa;IACrB,gCAAgC;IAChC,UAAU,eAAe;IACzB,0CAA0C;IAC1C,GAAG,QAAQ;CACZ;AAED,+DAA+D;AAC/D,oBAAY,YAAY;IACtB,wCAAwC;IACxC,QAAQ,aAAa;IACrB,oCAAoC;IACpC,SAAS,cAAc;IACvB,4EAA4E;IAC5E,YAAY,iBAAiB;CAC9B;AAED,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AAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,UAAU,GAAG,kBAAkB,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;gBAET,OAAO,EAAE,mBAAmB;IAmGxC;;;;;;;;;OASG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAE3B;IAED;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAA+C;IAExF,OAAO,CAAC,eAAe;IASvB,WAAW,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CA0L3D"}
|
package/script/scrapeconfig.js
CHANGED
|
@@ -110,7 +110,7 @@ class ScrapeConfig {
|
|
|
110
110
|
* Storage for the anti-bot bypass toggle, under its deprecated name.
|
|
111
111
|
* `unblocker` is an accessor over this same field — see below.
|
|
112
112
|
*
|
|
113
|
-
* @deprecated Use
|
|
113
|
+
* @deprecated Use {@link ScrapeConfig.unblocker}. `asp` keeps working forever.
|
|
114
114
|
*/
|
|
115
115
|
Object.defineProperty(this, "asp", {
|
|
116
116
|
enumerable: true,
|
|
@@ -137,12 +137,8 @@ class ScrapeConfig {
|
|
|
137
137
|
value: void 0
|
|
138
138
|
});
|
|
139
139
|
/**
|
|
140
|
-
* Proxy pool: `
|
|
141
|
-
*
|
|
142
|
-
* proxies and the Unblocker, the only pool accepted by the targets and
|
|
143
|
-
* anti-bot protections that have a price of their own) or `auto` (the API
|
|
144
|
-
* picks the pool from the target's profile), see {@link ScrapeConfig.BASIC}.
|
|
145
|
-
* Each sets the Unblocker itself.
|
|
140
|
+
* Proxy pool: `ScrapeConfig.PUBLIC_DATACENTER_POOL` (the default),
|
|
141
|
+
* `ScrapeConfig.PUBLIC_RESIDENTIAL_POOL` or `ScrapeConfig.PUBLIC_TOR_POOL`.
|
|
146
142
|
*/
|
|
147
143
|
Object.defineProperty(this, "proxy_pool", {
|
|
148
144
|
enumerable: true,
|
|
@@ -423,9 +419,6 @@ class ScrapeConfig {
|
|
|
423
419
|
}
|
|
424
420
|
/**
|
|
425
421
|
* The Unblocker toggle, the current name for what used to be `asp`.
|
|
426
|
-
* Deprecated: use `proxy_pool` (`ScrapeConfig.UNBLOCKER_ULTRA` for the
|
|
427
|
-
* Unblocker). The migration guide covers requests written before the proxy
|
|
428
|
-
* pools: https://scrapfly.io/new-pricing#legacy-spellings
|
|
429
422
|
*
|
|
430
423
|
* An accessor over the single `asp` field rather than a second stored
|
|
431
424
|
* property: one storage slot means the two names can never disagree, so
|
|
@@ -631,54 +624,51 @@ class ScrapeConfig {
|
|
|
631
624
|
}
|
|
632
625
|
}
|
|
633
626
|
exports.ScrapeConfig = ScrapeConfig;
|
|
634
|
-
// Proxy pools, sent as `proxy_pool`.
|
|
635
|
-
|
|
636
|
-
// target's profile: the Unblocker on datacenter proxies, or the pool the
|
|
637
|
-
// target needs, priced as the pool it runs on.
|
|
638
|
-
Object.defineProperty(ScrapeConfig, "BASIC", {
|
|
627
|
+
// Proxy pools, sent as `proxy_pool`. Datacenter proxies are the default.
|
|
628
|
+
Object.defineProperty(ScrapeConfig, "PUBLIC_DATACENTER_POOL", {
|
|
639
629
|
enumerable: true,
|
|
640
630
|
configurable: true,
|
|
641
631
|
writable: true,
|
|
642
|
-
value: '
|
|
632
|
+
value: 'public_datacenter_pool'
|
|
643
633
|
});
|
|
644
|
-
Object.defineProperty(ScrapeConfig, "
|
|
634
|
+
Object.defineProperty(ScrapeConfig, "PUBLIC_RESIDENTIAL_POOL", {
|
|
645
635
|
enumerable: true,
|
|
646
636
|
configurable: true,
|
|
647
637
|
writable: true,
|
|
648
|
-
value: '
|
|
638
|
+
value: 'public_residential_pool'
|
|
649
639
|
});
|
|
650
|
-
|
|
640
|
+
// The Tor network, the only pool that reaches .onion hidden services.
|
|
641
|
+
Object.defineProperty(ScrapeConfig, "PUBLIC_TOR_POOL", {
|
|
651
642
|
enumerable: true,
|
|
652
643
|
configurable: true,
|
|
653
644
|
writable: true,
|
|
654
|
-
value: '
|
|
645
|
+
value: 'public_tor_pool'
|
|
655
646
|
});
|
|
656
|
-
|
|
647
|
+
// Pool names the API does not accept yet: a request naming one fails with
|
|
648
|
+
// ERR::PROXY::POOL_NOT_FOUND.
|
|
649
|
+
Object.defineProperty(ScrapeConfig, "BASIC", {
|
|
657
650
|
enumerable: true,
|
|
658
651
|
configurable: true,
|
|
659
652
|
writable: true,
|
|
660
|
-
value: '
|
|
653
|
+
value: 'basic'
|
|
661
654
|
});
|
|
662
|
-
|
|
663
|
-
Object.defineProperty(ScrapeConfig, "PUBLIC_TOR_POOL", {
|
|
655
|
+
Object.defineProperty(ScrapeConfig, "UNBLOCKER", {
|
|
664
656
|
enumerable: true,
|
|
665
657
|
configurable: true,
|
|
666
658
|
writable: true,
|
|
667
|
-
value: '
|
|
659
|
+
value: 'unblocker'
|
|
668
660
|
});
|
|
669
|
-
|
|
670
|
-
// guide covers them: https://scrapfly.io/new-pricing#legacy-spellings
|
|
671
|
-
Object.defineProperty(ScrapeConfig, "PUBLIC_DATACENTER_POOL", {
|
|
661
|
+
Object.defineProperty(ScrapeConfig, "UNBLOCKER_ULTRA", {
|
|
672
662
|
enumerable: true,
|
|
673
663
|
configurable: true,
|
|
674
664
|
writable: true,
|
|
675
|
-
value: '
|
|
665
|
+
value: 'unblocker_ultra'
|
|
676
666
|
});
|
|
677
|
-
Object.defineProperty(ScrapeConfig, "
|
|
667
|
+
Object.defineProperty(ScrapeConfig, "AUTO", {
|
|
678
668
|
enumerable: true,
|
|
679
669
|
configurable: true,
|
|
680
670
|
writable: true,
|
|
681
|
-
value: '
|
|
671
|
+
value: 'auto'
|
|
682
672
|
});
|
|
683
673
|
/**
|
|
684
674
|
* Option names the constructor accepts that are not own properties of the
|
|
@@ -77,9 +77,8 @@ type ScreenshotConfigOptions = {
|
|
|
77
77
|
/** Webhook name to notify when the screenshot completes. */
|
|
78
78
|
webhook?: string;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* screenshot defaults apply. The screenshot price is the same on every pool.
|
|
80
|
+
* Sent as `proxy_pool`. The Screenshot API picks its pool itself and ignores
|
|
81
|
+
* this value.
|
|
83
82
|
*/
|
|
84
83
|
proxy_pool?: string;
|
|
85
84
|
};
|
|
@@ -111,7 +110,7 @@ export declare class ScreenshotConfig {
|
|
|
111
110
|
cache_clear?: boolean;
|
|
112
111
|
vision_deficiency?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'achromatopsia' | 'blurredVision' | 'reducedContrast' | VisionDeficiency;
|
|
113
112
|
webhook?: string;
|
|
114
|
-
/**
|
|
113
|
+
/** Sent as `proxy_pool`; the Screenshot API picks its pool itself and ignores it. */
|
|
115
114
|
proxy_pool?: string;
|
|
116
115
|
constructor(options: ScreenshotConfigOptions);
|
|
117
116
|
private validateOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshotconfig.d.ts","sourceRoot":"","sources":["../src/screenshotconfig.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,oBAAY,OAAO;IACjB,qEAAqE;IACrE,WAAW,gBAAgB;IAC3B,oCAAoC;IACpC,SAAS,cAAc;IACvB,+EAA+E;IAC/E,aAAa,kBAAkB;IAC/B,qDAAqD;IACrD,kBAAkB,uBAAuB;CAC1C;AAED,6CAA6C;AAC7C,oBAAY,MAAM;IAChB,qBAAqB;IACrB,GAAG,QAAQ;IACX,oBAAoB;IACpB,GAAG,QAAQ;IACX,qBAAqB;IACrB,IAAI,SAAS;IACb,kCAAkC;IAClC,GAAG,QAAQ;CACZ;AAED;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,0EAA0E;IAC1E,YAAY,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K,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IAC5I,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;gBAER,OAAO,EAAE,uBAAuB;IAgC5C,OAAO,CAAC,eAAe;IASvB;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CA6E3D"}
|
|
@@ -156,7 +156,7 @@ class ScreenshotConfig {
|
|
|
156
156
|
writable: true,
|
|
157
157
|
value: void 0
|
|
158
158
|
});
|
|
159
|
-
/**
|
|
159
|
+
/** Sent as `proxy_pool`; the Screenshot API picks its pool itself and ignores it. */
|
|
160
160
|
Object.defineProperty(this, "proxy_pool", {
|
|
161
161
|
enumerable: true,
|
|
162
162
|
configurable: true,
|
package/src/crawlerconfig.ts
CHANGED
|
@@ -136,23 +136,18 @@ export type CrawlerConfigOptions = {
|
|
|
136
136
|
* The Unblocker (anti-bot bypass), the current name for what used to be
|
|
137
137
|
* called `asp`. Sent in the `POST /crawl` body as `asp`; only the SDK-facing
|
|
138
138
|
* name changed.
|
|
139
|
-
*
|
|
140
|
-
* @deprecated Use `proxy_pool` (`'unblocker_ultra'` for the Unblocker). The
|
|
141
|
-
* migration guide covers requests written before the proxy pools:
|
|
142
|
-
* https://scrapfly.io/new-pricing#legacy-spellings
|
|
143
139
|
*/
|
|
144
140
|
unblocker?: boolean;
|
|
145
141
|
/**
|
|
146
|
-
* @deprecated
|
|
147
|
-
*
|
|
142
|
+
* @deprecated Use {@link CrawlerConfigOptions.unblocker}. `asp` is a
|
|
143
|
+
* permanently supported alias and keeps working forever. When both are
|
|
148
144
|
* supplied `asp` wins, so existing code cannot have its meaning changed by a
|
|
149
145
|
* later `unblocker`.
|
|
150
146
|
*/
|
|
151
147
|
asp?: boolean;
|
|
152
148
|
/**
|
|
153
|
-
* Proxy pool for every crawled page: `
|
|
154
|
-
*
|
|
155
|
-
* itself.
|
|
149
|
+
* Proxy pool for every crawled page: `public_datacenter_pool` (the default),
|
|
150
|
+
* `public_residential_pool` or `public_tor_pool`.
|
|
156
151
|
*/
|
|
157
152
|
proxy_pool?: string;
|
|
158
153
|
country?: string;
|
|
@@ -222,7 +217,7 @@ export class CrawlerConfig {
|
|
|
222
217
|
* Storage for the anti-bot bypass toggle, under its deprecated name.
|
|
223
218
|
* `unblocker` is an accessor over this same field — see below.
|
|
224
219
|
*
|
|
225
|
-
* @deprecated Use
|
|
220
|
+
* @deprecated Use {@link CrawlerConfig.unblocker}. `asp` keeps working forever.
|
|
226
221
|
*/
|
|
227
222
|
asp?: boolean;
|
|
228
223
|
proxy_pool?: string;
|
|
@@ -362,9 +357,6 @@ export class CrawlerConfig {
|
|
|
362
357
|
|
|
363
358
|
/**
|
|
364
359
|
* The Unblocker toggle, the current name for what used to be `asp`.
|
|
365
|
-
* Deprecated: use `proxy_pool` (`'unblocker_ultra'` for the Unblocker). The
|
|
366
|
-
* migration guide covers requests written before the proxy pools:
|
|
367
|
-
* https://scrapfly.io/new-pricing#legacy-spellings
|
|
368
360
|
*
|
|
369
361
|
* An accessor over the single `asp` field rather than a second stored
|
|
370
362
|
* property: one storage slot means the two names can never disagree, and
|
package/src/main.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* const client = new ScrapflyClient({ key: 'your-api-key' });
|
|
14
14
|
* const result = await client.scrape(new ScrapeConfig({
|
|
15
15
|
* url: 'https://web-scraping.dev/products',
|
|
16
|
-
*
|
|
16
|
+
* unblocker: true,
|
|
17
17
|
* }));
|
|
18
|
-
* console.log(result.content);
|
|
18
|
+
* console.log(result.result.content);
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* See the [Scrapfly docs](https://scrapfly.io/docs) for the full API
|
package/src/result.ts
CHANGED
|
@@ -17,13 +17,7 @@ export type ConfigData = {
|
|
|
17
17
|
debug: boolean;
|
|
18
18
|
raise_on_upstream_error: boolean;
|
|
19
19
|
cache_ttl: number;
|
|
20
|
-
/**
|
|
21
|
-
* The pool the request asked for, the way the account reads it: Tor reads `public_tor_pool` and one of the
|
|
22
|
-
* account's own pools its name. Otherwise, when the Unblocker ran (asked, or forced by a target that requires
|
|
23
|
-
* it), `basic` and `unblocker` read `unblocker` and any other pool `unblocker_ultra`. Without the Unblocker a
|
|
24
|
-
* Scrapfly pool reads by its network (`basic`, `unblocker`, `mobile`, `isp`) and any other name as sent.
|
|
25
|
-
* `context.proxy.pool` reads the same.
|
|
26
|
-
*/
|
|
20
|
+
/** The proxy pool the request ran on. */
|
|
27
21
|
proxy_pool: string;
|
|
28
22
|
session?: string;
|
|
29
23
|
tags: Set<string>;
|
|
@@ -81,7 +75,7 @@ export type ContextData = {
|
|
|
81
75
|
country: string;
|
|
82
76
|
identity: string;
|
|
83
77
|
network: string;
|
|
84
|
-
/** The
|
|
78
|
+
/** The proxy pool the request ran on. */
|
|
85
79
|
pool: string;
|
|
86
80
|
};
|
|
87
81
|
redirects: Array<string>;
|
|
@@ -166,6 +160,8 @@ export type ResultData = {
|
|
|
166
160
|
retryable: boolean;
|
|
167
161
|
doc_url?: string;
|
|
168
162
|
};
|
|
163
|
+
/** Present when the scrape ran an extraction (`extraction_model`, `extraction_prompt` or a template). */
|
|
164
|
+
extracted_data?: { data: any; content_type: string; data_quality?: any } | null;
|
|
169
165
|
format: string;
|
|
170
166
|
iframes: Array<{
|
|
171
167
|
url: string;
|
package/src/scrapeconfig.ts
CHANGED
|
@@ -58,30 +58,21 @@ type ScrapeConfigOptions = {
|
|
|
58
58
|
* The Unblocker (anti-bot bypass), the current name for what used to be
|
|
59
59
|
* called `asp`. Sent to the API as the `asp` query parameter; only the
|
|
60
60
|
* SDK-facing name changed.
|
|
61
|
-
*
|
|
62
|
-
* @deprecated Use `proxy_pool` (`ScrapeConfig.UNBLOCKER_ULTRA` for the
|
|
63
|
-
* Unblocker). The migration guide covers requests written before the proxy
|
|
64
|
-
* pools: https://scrapfly.io/new-pricing#legacy-spellings
|
|
65
61
|
*/
|
|
66
62
|
unblocker?: boolean;
|
|
67
63
|
/**
|
|
68
|
-
* @deprecated
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* `unblocker`.
|
|
64
|
+
* @deprecated Use {@link unblocker}. `asp` is a permanently supported alias
|
|
65
|
+
* and keeps working forever. When both are supplied `asp` wins, so existing
|
|
66
|
+
* code cannot have its meaning changed by a later `unblocker`.
|
|
72
67
|
*/
|
|
73
68
|
asp?: boolean;
|
|
74
69
|
debug?: boolean;
|
|
75
70
|
raise_on_upstream_error?: boolean;
|
|
76
71
|
cache_ttl?: number;
|
|
77
72
|
/**
|
|
78
|
-
* Proxy pool: `
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* anti-bot protections that have a price of their own: they refuse `basic`
|
|
82
|
-
* and `unblocker` with `ERR::PROXY::UNBLOCKER_ULTRA_REQUIRED`) or `auto`
|
|
83
|
-
* (the API picks the pool from the target's profile), see
|
|
84
|
-
* {@link ScrapeConfig.BASIC}. Each sets the Unblocker itself.
|
|
73
|
+
* Proxy pool: `ScrapeConfig.PUBLIC_DATACENTER_POOL` (the default),
|
|
74
|
+
* `ScrapeConfig.PUBLIC_RESIDENTIAL_POOL` or `ScrapeConfig.PUBLIC_TOR_POOL`.
|
|
75
|
+
* The anti-bot bypass is a parameter of its own: {@link unblocker}.
|
|
85
76
|
*/
|
|
86
77
|
proxy_pool?: string;
|
|
87
78
|
session?: string;
|
|
@@ -136,23 +127,19 @@ type ScrapeConfigOptions = {
|
|
|
136
127
|
};
|
|
137
128
|
|
|
138
129
|
export class ScrapeConfig {
|
|
139
|
-
// Proxy pools, sent as `proxy_pool`.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
//
|
|
130
|
+
// Proxy pools, sent as `proxy_pool`. Datacenter proxies are the default.
|
|
131
|
+
static PUBLIC_DATACENTER_POOL = 'public_datacenter_pool';
|
|
132
|
+
static PUBLIC_RESIDENTIAL_POOL = 'public_residential_pool';
|
|
133
|
+
// The Tor network, the only pool that reaches .onion hidden services.
|
|
134
|
+
static PUBLIC_TOR_POOL = 'public_tor_pool';
|
|
135
|
+
|
|
136
|
+
// Pool names the API does not accept yet: a request naming one fails with
|
|
137
|
+
// ERR::PROXY::POOL_NOT_FOUND.
|
|
143
138
|
static BASIC = 'basic';
|
|
144
139
|
static UNBLOCKER = 'unblocker';
|
|
145
140
|
static UNBLOCKER_ULTRA = 'unblocker_ultra';
|
|
146
141
|
static AUTO = 'auto';
|
|
147
142
|
|
|
148
|
-
// The Tor network, the only pool that reaches .onion hidden services.
|
|
149
|
-
static PUBLIC_TOR_POOL = 'public_tor_pool';
|
|
150
|
-
|
|
151
|
-
// Pool names written before the proxy pools, still accepted. The migration
|
|
152
|
-
// guide covers them: https://scrapfly.io/new-pricing#legacy-spellings
|
|
153
|
-
static PUBLIC_DATACENTER_POOL = 'public_datacenter_pool';
|
|
154
|
-
static PUBLIC_RESIDENTIAL_POOL = 'public_residential_pool';
|
|
155
|
-
|
|
156
143
|
url: string;
|
|
157
144
|
retry = true;
|
|
158
145
|
method: HttpMethod = 'GET';
|
|
@@ -167,19 +154,15 @@ export class ScrapeConfig {
|
|
|
167
154
|
* Storage for the anti-bot bypass toggle, under its deprecated name.
|
|
168
155
|
* `unblocker` is an accessor over this same field — see below.
|
|
169
156
|
*
|
|
170
|
-
* @deprecated Use
|
|
157
|
+
* @deprecated Use {@link ScrapeConfig.unblocker}. `asp` keeps working forever.
|
|
171
158
|
*/
|
|
172
159
|
asp = false;
|
|
173
160
|
debug = false;
|
|
174
161
|
raise_on_upstream_error = true;
|
|
175
162
|
cache_ttl?: number;
|
|
176
163
|
/**
|
|
177
|
-
* Proxy pool: `
|
|
178
|
-
*
|
|
179
|
-
* proxies and the Unblocker, the only pool accepted by the targets and
|
|
180
|
-
* anti-bot protections that have a price of their own) or `auto` (the API
|
|
181
|
-
* picks the pool from the target's profile), see {@link ScrapeConfig.BASIC}.
|
|
182
|
-
* Each sets the Unblocker itself.
|
|
164
|
+
* Proxy pool: `ScrapeConfig.PUBLIC_DATACENTER_POOL` (the default),
|
|
165
|
+
* `ScrapeConfig.PUBLIC_RESIDENTIAL_POOL` or `ScrapeConfig.PUBLIC_TOR_POOL`.
|
|
183
166
|
*/
|
|
184
167
|
proxy_pool?: string;
|
|
185
168
|
session?: string;
|
|
@@ -314,9 +297,6 @@ export class ScrapeConfig {
|
|
|
314
297
|
|
|
315
298
|
/**
|
|
316
299
|
* The Unblocker toggle, the current name for what used to be `asp`.
|
|
317
|
-
* Deprecated: use `proxy_pool` (`ScrapeConfig.UNBLOCKER_ULTRA` for the
|
|
318
|
-
* Unblocker). The migration guide covers requests written before the proxy
|
|
319
|
-
* pools: https://scrapfly.io/new-pricing#legacy-spellings
|
|
320
300
|
*
|
|
321
301
|
* An accessor over the single `asp` field rather than a second stored
|
|
322
302
|
* property: one storage slot means the two names can never disagree, so
|
package/src/screenshotconfig.ts
CHANGED
|
@@ -84,9 +84,8 @@ type ScreenshotConfigOptions = {
|
|
|
84
84
|
/** Webhook name to notify when the screenshot completes. */
|
|
85
85
|
webhook?: string;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* screenshot defaults apply. The screenshot price is the same on every pool.
|
|
87
|
+
* Sent as `proxy_pool`. The Screenshot API picks its pool itself and ignores
|
|
88
|
+
* this value.
|
|
90
89
|
*/
|
|
91
90
|
proxy_pool?: string;
|
|
92
91
|
};
|
|
@@ -119,7 +118,7 @@ export class ScreenshotConfig {
|
|
|
119
118
|
cache_clear?: boolean;
|
|
120
119
|
vision_deficiency?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'achromatopsia' | 'blurredVision' | 'reducedContrast' | VisionDeficiency;
|
|
121
120
|
webhook?: string;
|
|
122
|
-
/**
|
|
121
|
+
/** Sent as `proxy_pool`; the Screenshot API picks its pool itself and ignores it. */
|
|
123
122
|
proxy_pool?: string;
|
|
124
123
|
|
|
125
124
|
constructor(options: ScreenshotConfigOptions) {
|