@crawlee/linkedom 4.0.0-beta.134 → 4.0.0-beta.136

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,8 +1,7 @@
1
- import type { AddRequestsBatchedResult, CrawlingContext, EnqueueLinksOptions, ErrorHandler, ExtractLinksOptions, GetUserDataFromRequest, HttpCrawlerOptions, InternalHttpCrawlingContext, InternalHttpHook, RequestHandler, RouterHandler, RouterRoutes, RouteSchemas, RoutesFromSchemas } from '@crawlee/http';
1
+ import type { AddRequestsBatchedResult, ContextPipeline, CrawlingContext, EnqueueLinksOptions, ErrorHandler, ExtractLinksOptions, GetUserDataFromRequest, HttpCrawlerOptions, InternalHttpCrawlingContext, InternalHttpHook, RequestHandler, RouterHandler, RouterRoutes, RouteSchemas, RoutesFromSchemas } from '@crawlee/http';
2
2
  import { HttpCrawler } from '@crawlee/http';
3
3
  import type { Dictionary } from '@crawlee/types';
4
- import { type CheerioRoot } from '@crawlee/utils/internal';
5
- import * as cheerio from 'cheerio';
4
+ import type { CheerioAPI } from 'cheerio';
6
5
  export type LinkeDOMErrorHandler<UserData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
7
6
  JSONData extends Dictionary = any, // with default to Dictionary we cant use a typed router in untyped crawler
8
7
  ContextExtension = Dictionary<never>> = ErrorHandler<CrawlingContext, LinkeDOMCrawlingContext<UserData, JSONData> & ContextExtension>;
@@ -42,7 +41,7 @@ JSONData extends Dictionary = any> extends InternalHttpCrawlingContext<UserData,
42
41
  * });
43
42
  * ```
44
43
  */
45
- parseWithCheerio(selector?: string, timeoutMs?: number): Promise<CheerioRoot>;
44
+ parseWithCheerio(selector?: string, timeoutMs?: number): Promise<CheerioAPI>;
46
45
  /**
47
46
  * Extracts URLs from the parsed DOM, without adding them to the request queue.
48
47
  */
@@ -129,17 +128,7 @@ JSONData extends Dictionary = any> = RequestHandler<LinkeDOMCrawlingContext<User
129
128
  export declare class LinkeDOMCrawler<ContextExtension = Dictionary<never>, ExtendedContext extends LinkeDOMCrawlingContext = LinkeDOMCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<LinkeDOMCrawlingContext['request']>>, StatisticStateExtension extends object = {}> extends HttpCrawler<LinkeDOMCrawlingContext, ContextExtension, ExtendedContext, Routes, StatisticStateExtension> {
130
129
  #private;
131
130
  constructor(options?: LinkeDOMCrawlerOptions<ContextExtension, ExtendedContext, any, any, Routes, StatisticStateExtension>);
132
- // @ts-ignore optional peer dependency or compatibility with es2022
133
- protected buildContextPipeline(): import("@crawlee/http").ContextPipeline<CrawlingContext<Dictionary>, InternalHttpCrawlingContext<any, any> & {
134
- readonly window: Window;
135
- readonly body: string;
136
- readonly document: Document;
137
- } & {
138
- extractLinks: (options?: ExtractLinksOptions) => Promise<string[]>;
139
- enqueueLinks: (options?: EnqueueLinksOptions) => Promise<AddRequestsBatchedResult>;
140
- waitForSelector(selector: string, timeoutMs?: number): Promise<void>;
141
- parseWithCheerio(selector?: string, _timeoutMs?: number): Promise<cheerio.CheerioAPI>;
142
- }>;
131
+ protected buildContextPipeline(): ContextPipeline<CrawlingContext, LinkeDOMCrawlingContext>;
143
132
  private parseContent;
144
133
  private addHelpers;
145
134
  }
@@ -1,5 +1,6 @@
1
- import { EnqueueStrategy, HttpCrawler, NavigationSkippedError, resolveBaseUrlForEnqueueLinksFiltering, Router, tryAbsoluteURL, } from '@crawlee/http';
1
+ import { EnqueueStrategy, HttpCrawler, NavigationSkippedError, resolveBaseUrlForEnqueueLinksFiltering, Router, } from '@crawlee/http';
2
2
  import { sleep } from '@crawlee/utils';
3
+ import { tryAbsoluteURL } from '@crawlee/utils/internal';
3
4
  import * as cheerio from 'cheerio';
4
5
  import { DOMParser } from 'linkedom/cached';
5
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/linkedom",
3
- "version": "4.0.0-beta.134",
3
+ "version": "4.0.0-beta.136",
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"
@@ -49,9 +49,9 @@
49
49
  "dependencies": {
50
50
  "@apify/timeout": "^0.4.4",
51
51
  "@apify/utilities": "^2.15.5",
52
- "@crawlee/http": "4.0.0-beta.134",
53
- "@crawlee/types": "4.0.0-beta.134",
54
- "@crawlee/utils": "4.0.0-beta.134",
52
+ "@crawlee/http": "4.0.0-beta.136",
53
+ "@crawlee/types": "4.0.0-beta.136",
54
+ "@crawlee/utils": "4.0.0-beta.136",
55
55
  "cheerio": "^1.0.0",
56
56
  "linkedom": "^0.18.10",
57
57
  "tslib": "^2.8.1"
@@ -63,5 +63,5 @@
63
63
  }
64
64
  }
65
65
  },
66
- "gitHead": "0f269d5b24ec2829f3d44c19a35973fa20d95999"
66
+ "gitHead": "d425bb9841885b4b71b84ae6fb0bafbdc4a7e978"
67
67
  }