DOMParser <Parsed>
Index
Properties
Methods
Properties
optionalreadonlymutable
Whether the parse result can change after parse returned - the case when the DOM
implementation runs the page scripts. If it can, waitForSelector
polls until the timeout elapses; otherwise it fails as soon as the selector does not match.
readonlyplaceholderMembers
The context members parse contributes, mapped to true. Used to build the
placeholders that report a helpful error when the members are accessed after skipNavigation - the Record
type forces every key of Parsed to be listed, so the compiler catches an omission that would otherwise
yield undefined (rather than throwing) after skipNavigation.
Methods
optionalcleanup
Releases whatever
parseallocated. Called after the request handler finishes or fails, and skipped entirely when navigation was skipped.Parameters
parsed: Parsed
Returns Awaitable<void>
extractLinks
Returns the URLs the
selectormatches, resolved againstbaseUrl.Parameters
parsed: Parsed
selector: string
baseUrl: string
Returns Awaitable<string[]>
parse
Parameters
context: InternalHttpCrawlingContext<any, any>
Returns Awaitable<Parsed>
select
Returns the current matches of
selector. Only the count is used, bywaitForSelector.Parameters
parsed: Parsed
selector: string
Returns Awaitable<ArrayLike<unknown>>
optionaltoCheerio
Returns a Cheerio handle over the parse result, for parsers that are backed by Cheerio anyway. Without it,
parseWithCheerioparsesbodyagain.Parameters
parsed: Parsed
Returns Awaitable<CheerioAPI>
Turns a response body into a DOM representation and knows how to query it. Passing one to DOMCrawler is what makes the crawler jsdom-based, linkedom-based, or based on a DOM implementation of your own.
Example usage: