@crawlee/cli 4.0.0-beta.326 → 4.0.0-beta.328
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/cli",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.328",
|
|
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"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@crawlee/templates": "4.0.0-beta.
|
|
48
|
+
"@crawlee/templates": "4.0.0-beta.328",
|
|
49
49
|
"@inquirer/prompts": "^8.8.1",
|
|
50
50
|
"ansi-colors": "^4.1.3",
|
|
51
51
|
"semver": "^7.8.5",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "dfb2fb79cfb0e188e9118a0ec2be614a64732f0a"
|
|
63
63
|
}
|
|
@@ -56,6 +56,9 @@ The following properties have been removed from `HttpRequest`, as v4's HTTP clie
|
|
|
56
56
|
- `throwHttpErrors` — `sendRequest` never throws on an HTTP error status; inspect `response.status` yourself. The crawler's `additionalHttpErrorStatusCodes` / `ignoreHttpErrorStatusCodes` options only cover the crawled request itself.
|
|
57
57
|
- `responseType` (and the `HttpRequest<TResponseType>` type parameter) — read the body from the returned `Response` with `response.json()` / `response.text()` / `response.bytes()`.
|
|
58
58
|
- `maxRedirects` — redirect following is handled inside `BaseHttpClient.sendRequest` and capped at 10 redirects; it is no longer configurable per request.
|
|
59
|
+
- `encoding` — a `Response` has no decoding option. Decode the bytes yourself, e.g. `new TextDecoder('latin1').decode(await response.arrayBuffer())`.
|
|
60
|
+
|
|
61
|
+
`followRedirect` now only accepts a boolean. With `followRedirect: false`, `sendRequest` returns the redirect response instead of following it; the predicate form is gone.
|
|
59
62
|
|
|
60
63
|
### Remaining `HttpRequest` properties changed type
|
|
61
64
|
|
|
@@ -140,7 +140,7 @@ import { SitemapRequestLoader } from 'crawlee';
|
|
|
140
140
|
const loader = await SitemapRequestLoader.open({ sitemapUrls: ['https://example.com/sitemap.xml'] });
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
The default `KeyValueStore` key used to persist the loader's state was also renamed from `SITEMAP_REQUEST_LIST_STATE` to `
|
|
143
|
+
The default `KeyValueStore` key used to persist the loader's state was also renamed from `SITEMAP_REQUEST_LIST_STATE` to `CRAWLEE_SITEMAP_REQUEST_LOADER_STATE`. State persisted under the old key by a v3 run will **not** be picked up after upgrading; resuming a v3 crawl on v4 is not supported, so finish or discard in-flight sitemap crawls before upgrading.
|
|
144
144
|
|
|
145
145
|
### Crawler `requestList` / `requestQueue` options deprecated in favor of `requestManager`
|
|
146
146
|
|
|
@@ -82,7 +82,7 @@ The request queue backend's surface was reshaped. The frontend-owned distributed
|
|
|
82
82
|
|
|
83
83
|
The lifecycle is now: `fetchNextRequest()` hands out a pending request and marks it in progress; once processed, call `markRequestAsHandled(request)`; on failure call `reclaimRequest(request, { forefront? })` to return it to the queue.
|
|
84
84
|
|
|
85
|
-
Methods that may have "nothing" to return now consistently resolve to `undefined` rather than `null`. `fetchNextRequest()` resolves to `undefined` when there is nothing to fetch, and `markRequestAsHandled()` / `reclaimRequest()` resolve to `undefined` when the request is not something the backend is currently processing (a
|
|
85
|
+
Methods that may have "nothing" to return now consistently resolve to `undefined` rather than `null`. `fetchNextRequest()` resolves to `undefined` when there is nothing to fetch, and `markRequestAsHandled()` / `reclaimRequest()` resolve to `undefined` when the request is not something the backend is currently processing (not an error; a backend may still apply the operation, as the memory backend does, but the result stays `undefined`). This matches the `undefined` already returned by `getRequest()`, `KeyValueStoreBackend.getValue()`, and `getPublicUrl()`, so the whole backend family uses a single "absent" sentinel. If you implemented a custom backend that returned `null` from these methods, return `undefined` instead.
|
|
86
86
|
|
|
87
87
|
`RequestQueueBackend.isEmpty()` and `RequestQueueBackend.isFinished()` answer two different questions:
|
|
88
88
|
|
|
@@ -80,7 +80,7 @@ The purely mechanical renames, collected in one place. Where a row links to a se
|
|
|
80
80
|
| `statistics.startJob()` / `finishJob()` / `failJob()` | `recordRequestStart()` / `recordRequestSuccess()` / `recordRequestFailure()` ([details](./statistics.md#the-request-recording-methods-are-renamed)) |
|
|
81
81
|
| `browserPoolOptions` | `browserPool` + a `*BrowserPool()` factory ([details](#browserpooloptions-is-removed)) |
|
|
82
82
|
| `gotScraping` (from `@crawlee/utils`) | `GotScrapingHttpClient` (`@crawlee/got-scraping-client`) |
|
|
83
|
-
| `SDK_
|
|
83
|
+
| Internal KVS keys (`SDK_*` and others) | `CRAWLEE_*` keys ([details](#internal-kvs-keys-renamed)) |
|
|
84
84
|
| `ArgumentError` (from `ow`) | `ArgumentValidationError` ([details](#argument-validation-errors-use-zod)) |
|
|
85
85
|
|
|
86
86
|
## Changes most users will hit
|
|
@@ -564,7 +564,7 @@ The `PersistenceOptions` argument of `persistState()` and `resetStore()` and the
|
|
|
564
564
|
|
|
565
565
|
With both `state` and `persistStateKey` set, the record now wins. Previously `state` did. The option is also validated up front: `nextIndex` must be a non-negative integer and `inProgress` an array of unique keys. The `@internal` `isStatePersisted` flag is gone.
|
|
566
566
|
|
|
567
|
-
Both `SessionPool` and `RequestList` now persist through `RecoverableState`, like `Statistics`. Resuming a v3 crawl on v4 is not supported: `RequestList` stores its records under
|
|
567
|
+
Both `SessionPool` and `RequestList` now persist through `RecoverableState`, like `Statistics`. Resuming a v3 crawl on v4 is not supported: `RequestList` stores its records under [new keys](#internal-kvs-keys-renamed), so a v4 run does not find a v3 run's state and starts the list from the beginning. Finish or discard in-flight crawls before upgrading.
|
|
568
568
|
|
|
569
569
|
### `retireOnBlockedStatusCodes` is removed from `Session`
|
|
570
570
|
|
|
@@ -1182,7 +1182,20 @@ With `respectRobotsTxtFile` enabled, a site that answers `/robots.txt` with a `5
|
|
|
1182
1182
|
|
|
1183
1183
|
### Internal KVS keys renamed
|
|
1184
1184
|
|
|
1185
|
-
|
|
1185
|
+
Crawlee keeps its internal state in the default key-value store. These records now use the `CRAWLEE_` prefix and upper snake case, with the dynamic part at the end. Crawlee for Python uses the same keys.
|
|
1186
|
+
|
|
1187
|
+
| Record | v3 key | v4 key |
|
|
1188
|
+
| --- | --- | --- |
|
|
1189
|
+
| Crawler statistics | `SDK_CRAWLER_STATISTICS_{id}` | `CRAWLEE_CRAWLER_STATISTICS_{id}` |
|
|
1190
|
+
| Session pool | `SDK_SESSION_POOL_STATE` | `CRAWLEE_SESSION_POOL_STATE_{id}` |
|
|
1191
|
+
| Request list progress | `SDK_{name}-REQUEST_LIST_STATE` | `CRAWLEE_REQUEST_LIST_STATE_{name}` |
|
|
1192
|
+
| Request list requests | `SDK_{name}-REQUEST_LIST_REQUESTS` | `CRAWLEE_REQUEST_LIST_REQUESTS_{name}` |
|
|
1193
|
+
| Sitemap request loader | `SITEMAP_REQUEST_LIST_STATE` | `CRAWLEE_SITEMAP_REQUEST_LOADER_STATE` |
|
|
1194
|
+
| Rendering type predictor | `rendering-type-predictor-state` | `CRAWLEE_RENDERING_TYPE_PREDICTOR_STATE_{id}` |
|
|
1195
|
+
|
|
1196
|
+
A `persistStateKey` or `persistRequestsKey` you pass to `RequestList` is used as it is, without the `SDK_` prefix v3 added, so a v4 run doesn't find the v3 record under `SDK_{key}`. The `{id}` of the statistics, the session pool, the rendering type predictor and the `ThrottlingRequestManager` comes from their `id` option. Without one, each class numbers its instances in creation order. The ones a crawler creates take the crawler's `id` option when it is set. Adaptive crawlers no longer share one rendering type model. The `ThrottlingRequestManager` stores its domain list under `CRAWLEE_THROTTLED_DOMAINS_{id}` and opens its per-domain queues under the alias `throttled-{id}-{domain}`.
|
|
1197
|
+
|
|
1198
|
+
v4 doesn't read the v3 keys. Resuming a v3 crawl on v4 is not supported, so finish or discard in-flight crawls before upgrading.
|
|
1186
1199
|
|
|
1187
1200
|
## Only if you subclassed crawlers or touched internals
|
|
1188
1201
|
|