@crawlee/puppeteer 3.17.1-beta.4 → 3.17.1-beta.41
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,4 +1,4 @@
|
|
|
1
|
-
import type { BrowserCrawlerOptions, BrowserCrawlingContext, BrowserHook, BrowserRequestHandler, GetUserDataFromRequest, LoadedContext, RouterRoutes } from '@crawlee/browser';
|
|
1
|
+
import type { BrowserCrawlerOptions, BrowserCrawlingContext, BrowserHook, BrowserRequestHandler, GetUserDataFromRequest, LoadedContext, RouterHandler, RouterRoutes } from '@crawlee/browser';
|
|
2
2
|
import { BrowserCrawler, Configuration } from '@crawlee/browser';
|
|
3
3
|
import type { PuppeteerController, PuppeteerPlugin } from '@crawlee/browser-pool';
|
|
4
4
|
import type { Dictionary } from '@crawlee/types';
|
|
@@ -239,5 +239,5 @@ export declare class PuppeteerCrawler extends BrowserCrawler<{
|
|
|
239
239
|
* await crawler.run();
|
|
240
240
|
* ```
|
|
241
241
|
*/
|
|
242
|
-
|
|
243
|
-
export declare function createPuppeteerRouter<Context extends PuppeteerCrawlingContext = PuppeteerCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, UserData
|
|
242
|
+
export declare function createPuppeteerRouter<Context extends PuppeteerCrawlingContext = PuppeteerCrawlingContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>>(routes?: RouterRoutes<Context, Routes>): RouterHandler<Context, Routes>;
|
|
243
|
+
export declare function createPuppeteerRouter<Context extends PuppeteerCrawlingContext = PuppeteerCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
|
|
@@ -127,30 +127,6 @@ Object.defineProperty(PuppeteerCrawler, "optionsShape", {
|
|
|
127
127
|
browserPoolOptions: ow_1.default.optional.object,
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
/**
|
|
131
|
-
* Creates new {@link Router} instance that works based on request labels.
|
|
132
|
-
* This instance can then serve as a `requestHandler` of your {@link PuppeteerCrawler}.
|
|
133
|
-
* Defaults to the {@link PuppeteerCrawlingContext}.
|
|
134
|
-
*
|
|
135
|
-
* > Serves as a shortcut for using `Router.create<PuppeteerCrawlingContext>()`.
|
|
136
|
-
*
|
|
137
|
-
* ```ts
|
|
138
|
-
* import { PuppeteerCrawler, createPuppeteerRouter } from 'crawlee';
|
|
139
|
-
*
|
|
140
|
-
* const router = createPuppeteerRouter();
|
|
141
|
-
* router.addHandler('label-a', async (ctx) => {
|
|
142
|
-
* ctx.log.info('...');
|
|
143
|
-
* });
|
|
144
|
-
* router.addDefaultHandler(async (ctx) => {
|
|
145
|
-
* ctx.log.info('...');
|
|
146
|
-
* });
|
|
147
|
-
*
|
|
148
|
-
* const crawler = new PuppeteerCrawler({
|
|
149
|
-
* requestHandler: router,
|
|
150
|
-
* });
|
|
151
|
-
* await crawler.run();
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
130
|
function createPuppeteerRouter(routes) {
|
|
155
131
|
return browser_1.Router.create(routes);
|
|
156
132
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/puppeteer",
|
|
3
|
-
"version": "3.17.1-beta.
|
|
3
|
+
"version": "3.17.1-beta.41",
|
|
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": ">=16.0.0"
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@apify/datastructures": "^2.0.0",
|
|
57
57
|
"@apify/log": "^2.4.0",
|
|
58
|
-
"@crawlee/browser": "3.17.1-beta.
|
|
59
|
-
"@crawlee/browser-pool": "3.17.1-beta.
|
|
60
|
-
"@crawlee/types": "3.17.1-beta.
|
|
61
|
-
"@crawlee/utils": "3.17.1-beta.
|
|
58
|
+
"@crawlee/browser": "3.17.1-beta.41",
|
|
59
|
+
"@crawlee/browser-pool": "3.17.1-beta.41",
|
|
60
|
+
"@crawlee/types": "3.17.1-beta.41",
|
|
61
|
+
"@crawlee/utils": "3.17.1-beta.41",
|
|
62
62
|
"cheerio": "1.0.0-rc.12",
|
|
63
63
|
"devtools-protocol": "*",
|
|
64
64
|
"idcac-playwright": "^0.2.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "6c01783829190e9904fc1288ac62844e552414e6"
|
|
89
89
|
}
|