Cheerio

Html document traversal and manipulation with cheerio

See:

Example

rps install cheerio

Actions

cheerio :: String → CheerioStatic

Parameters:
Name Type Description
document string

Html document.

Returns:
Cheerio -

cheerio object.

Example
; load document to cheerio
cheerio "<h2 class='title'>Hello <span class='wei'>wei</span> world</h2>"| 'doc'
selector $doc 'h2' First Text

selector :: CheerioStatic → String|Cheerio → ...

Parameters:
Name Type Attributes Description
selector CheerioStatic

The selector to traverse/manipulate.

context String | Cheerio

context of the document.

chains * <repeatable>

The chain to navigate. Capital word represents function in cheerio.

Example
;load document to cheerio
cheerio "<h2 class='title'>Hello <span class='wei'>wei</span> world</h2>" | 'doc'

;equivalent to $('h2').children().first().text() in cheerio
selector $doc 'h2' Children First Text
-->