@crawlee/linkedom 3.17.1-beta.21 → 3.17.1-beta.23
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,5 +1,5 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'node:http';
|
|
2
|
-
import type { BasicCrawlingContext, EnqueueLinksOptions, ErrorHandler, GetUserDataFromRequest, HttpCrawlerOptions, InternalHttpCrawlingContext, InternalHttpHook, RequestHandler, RequestProvider, RouterRoutes, SkippedRequestCallback } from '@crawlee/http';
|
|
2
|
+
import type { BasicCrawlingContext, EnqueueLinksOptions, ErrorHandler, GetUserDataFromRequest, HttpCrawlerOptions, InternalHttpCrawlingContext, InternalHttpHook, RequestHandler, RequestProvider, RouterHandler, RouterRoutes, SkippedRequestCallback } from '@crawlee/http';
|
|
3
3
|
import { HttpCrawler } from '@crawlee/http';
|
|
4
4
|
import type { Dictionary } from '@crawlee/types';
|
|
5
5
|
import { type CheerioRoot, type RobotsTxtFile } from '@crawlee/utils';
|
|
@@ -170,6 +170,6 @@ export declare function linkedomCrawlerEnqueueLinks(options: EnqueueLinksInterna
|
|
|
170
170
|
* await crawler.run();
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
|
-
|
|
174
|
-
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, UserData
|
|
173
|
+
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<Context['request']>>>(routes?: RouterRoutes<Context, Routes>): RouterHandler<Context, Routes>;
|
|
174
|
+
export declare function createLinkeDOMRouter<Context extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext, UserData extends Dictionary = GetUserDataFromRequest<Context['request']>>(routes?: RouterRoutes<Context, Record<string, UserData>>): RouterHandler<Context, Record<string, UserData>>;
|
|
175
175
|
export {};
|
|
@@ -184,30 +184,6 @@ function extractUrlsFromWindow(window, selector, baseUrl) {
|
|
|
184
184
|
})
|
|
185
185
|
.filter((href) => href !== undefined && href !== '');
|
|
186
186
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Creates new {@link Router} instance that works based on request labels.
|
|
189
|
-
* This instance can then serve as a `requestHandler` of your {@link LinkeDOMCrawler}.
|
|
190
|
-
* Defaults to the {@link LinkeDOMCrawlingContext}.
|
|
191
|
-
*
|
|
192
|
-
* > Serves as a shortcut for using `Router.create<LinkeDOMCrawlingContext>()`.
|
|
193
|
-
*
|
|
194
|
-
* ```ts
|
|
195
|
-
* import { LinkeDOMCrawler, createLinkeDOMRouter } from 'crawlee';
|
|
196
|
-
*
|
|
197
|
-
* const router = createLinkeDOMRouter();
|
|
198
|
-
* router.addHandler('label-a', async (ctx) => {
|
|
199
|
-
* ctx.log.info('...');
|
|
200
|
-
* });
|
|
201
|
-
* router.addDefaultHandler(async (ctx) => {
|
|
202
|
-
* ctx.log.info('...');
|
|
203
|
-
* });
|
|
204
|
-
*
|
|
205
|
-
* const crawler = new LinkeDOMCrawler({
|
|
206
|
-
* requestHandler: router,
|
|
207
|
-
* });
|
|
208
|
-
* await crawler.run();
|
|
209
|
-
* ```
|
|
210
|
-
*/
|
|
211
187
|
function createLinkeDOMRouter(routes) {
|
|
212
188
|
return http_1.Router.create(routes);
|
|
213
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/linkedom",
|
|
3
|
-
"version": "3.17.1-beta.
|
|
3
|
+
"version": "3.17.1-beta.23",
|
|
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,8 +55,8 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@apify/timeout": "^0.3.0",
|
|
57
57
|
"@apify/utilities": "^2.7.10",
|
|
58
|
-
"@crawlee/http": "3.17.1-beta.
|
|
59
|
-
"@crawlee/types": "3.17.1-beta.
|
|
58
|
+
"@crawlee/http": "3.17.1-beta.23",
|
|
59
|
+
"@crawlee/types": "3.17.1-beta.23",
|
|
60
60
|
"linkedom": "^0.18.0",
|
|
61
61
|
"ow": "^0.28.2",
|
|
62
62
|
"tslib": "^2.4.0"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "704d91af7d46c2efaf8bff883025e4a7d8ffd6d7"
|
|
72
72
|
}
|