CheerioAPI
A querying function, bound to a document created from the provided markup.
Also provides several helper methods for dealing with the document as a whole.
interface CheerioAPI extends StaticType, LoadType {
<T extends Node, S extends string>(
selector?: S | BasicAcceptedElems<T>,
context?: BasicAcceptedElems<Node> | null,
root?: BasicAcceptedElems<Document>,
options?: CheerioOptions,
): Cheerio<S extends SelectorType ? Element : T>;_options: InternalOptions;
_root: Document;
fn: Cheerio.prototype;
}§Call Signatures
§
<T extends Node, S extends string>(selector?: S | BasicAcceptedElems<T>, context?: BasicAcceptedElems<Node> | null, root?: BasicAcceptedElems<Document>, options?: CheerioOptions): Cheerio<S extends SelectorType ? Element : T>
[src]This selector method is the starting point for traversing and manipulating the document. Like jQuery, it's the primary method for selecting elements in the document.
selector
searches within the context
scope which searches within the
root
scope.
@example
$('.apple', '#fruits').text();
//=> Apple
$('ul .pear').attr('class');
//=> pear
$('li[class=orange]').html();
//=> Orange