Methods
add
-
Parameters
-
Parameters
-
selector: string
-
context: Document
-
Parameters
-
Parameters
-
Parameters
addClass
- addClass(classNames: string): Cheerio
after
- after(content: string, ...contents: unknown[]): Cheerio
- after(content: Document, ...contents: unknown[]): Cheerio
- after(content: Document[], ...contents: unknown[]): Cheerio
- after(content: Cheerio, ...contents: unknown[]): Cheerio
-
Parameters
-
content: string
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document[]
-
Rest ...contents: unknown[]
-
Parameters
-
-
Rest ...contents: unknown[]
append
- append(content: string, ...contents: unknown[]): Cheerio
- append(content: Document, ...contents: unknown[]): Cheerio
- append(content: Document[], ...contents: unknown[]): Cheerio
- append(content: Cheerio, ...contents: unknown[]): Cheerio
-
Parameters
-
content: string
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document[]
-
Rest ...contents: unknown[]
-
Parameters
-
-
Rest ...contents: unknown[]
attr
-
Returns {}
-
Parameters
Returns string | undefined
-
Parameters
-
Parameters
-
name: string
-
value: string
-
Parameters
before
- before(content: string, ...contents: unknown[]): Cheerio
- before(content: Document, ...contents: unknown[]): Cheerio
- before(content: Document[], ...contents: unknown[]): Cheerio
- before(content: Cheerio, ...contents: unknown[]): Cheerio
-
Parameters
-
content: string
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document[]
-
Rest ...contents: unknown[]
-
Parameters
-
-
Rest ...contents: unknown[]
children
- children(selector?: string): Cheerio
-
Parameters
-
Optional selector: string
css
- css(propertyName: string): string
- css(propertyNames: string[]): string[]
- css(propertyName: string, value: string): Cheerio
- css(propertyName: string, value: number): Cheerio
- css(propertyName: string, func: (index: number, value: string) => string): Cheerio
- css(propertyName: string, func: (index: number, value: string) => number): Cheerio
- css(properties: Record<string, string>): Cheerio
-
Parameters
Returns string
-
Parameters
Returns string[]
-
Parameters
-
propertyName: string
-
value: string
-
Parameters
-
propertyName: string
-
value: number
-
Parameters
-
propertyName: string
-
func: (index: number, value: string) => string
-
- (index: number, value: string): string
-
Parameters
-
index: number
-
value: string
Returns string
-
Parameters
-
propertyName: string
-
func: (index: number, value: string) => number
-
- (index: number, value: string): number
-
Parameters
-
index: number
-
value: string
Returns number
-
Parameters
-
properties: Record<string, string>
data
- data(): unknown
- data(name: string): unknown
- data(name: string, value: unknown): unknown
-
Returns unknown
-
Parameters
Returns unknown
-
Parameters
-
name: string
-
value: unknown
Returns unknown
each
-
Type parameters
Parameters
-
func: (index: number, element: Element) => T
-
- (index: number, element: Element): T
filter
-
Parameters
-
Parameters
-
Parameters
-
Parameters
-
Parameters
-
func: (index: number, element: Element) => boolean
-
- (index: number, element: Element): boolean
-
Parameters
Returns boolean
get
- get(): T[]
- get(index: number): T
-
Returns T[]
-
Parameters
Returns T
hasClass
- hasClass(className: string): boolean
-
Parameters
Returns boolean
html
- html(): string | null
- html(html: string): Cheerio
-
Returns string | null
-
Parameters
index
- index(): number
- index(selector: string): number
- index(selection: Cheerio): number
-
Returns number
-
Parameters
Returns number
-
Parameters
Returns number
insertAfter
-
Parameters
-
Parameters
-
Parameters
insertBefore
-
Parameters
-
Parameters
-
Parameters
is
- is(selector: string): boolean
- is(element: Element): boolean
- is(element: Element[]): boolean
- is(selection: Cheerio): boolean
- is(func: (index: number, element: Element) => boolean): boolean
-
Parameters
Returns boolean
-
Parameters
Returns boolean
-
Parameters
Returns boolean
-
Parameters
Returns boolean
-
Parameters
-
func: (index: number, element: Element) => boolean
-
- (index: number, element: Element): boolean
-
Parameters
Returns boolean
Returns boolean
map
-
Type parameters
Parameters
-
func: (index: number, element: Element) => T
-
- (index: number, element: Element): T
next
-
Parameters
-
Optional selector: string
nextUntil
-
Parameters
-
Optional selector: string
-
Optional filter: string
-
Parameters
-
Parameters
not
-
Parameters
-
Parameters
-
Parameters
-
Parameters
-
func: (index: number, element: Element) => boolean
-
- (index: number, element: Element): boolean
-
Parameters
Returns boolean
parent
-
Parameters
-
Optional selector: string
parents
- parents(selector?: string): Cheerio
-
Parameters
-
Optional selector: string
parentsUntil
-
Parameters
-
Optional selector: string
-
Optional filter: string
-
Parameters
-
Parameters
prepend
- prepend(content: string, ...contents: unknown[]): Cheerio
- prepend(content: Document, ...contents: unknown[]): Cheerio
- prepend(content: Document[], ...contents: unknown[]): Cheerio
- prepend(content: Cheerio, ...contents: unknown[]): Cheerio
-
Parameters
-
content: string
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document
-
Rest ...contents: unknown[]
-
Parameters
-
content: Document[]
-
Rest ...contents: unknown[]
-
Parameters
-
-
Rest ...contents: unknown[]
prev
-
Parameters
-
Optional selector: string
prevUntil
-
Parameters
-
Optional selector: string
-
Optional filter: string
-
Parameters
-
Parameters
prop
- prop(name: string): unknown
- prop(name: string, value: unknown): Cheerio
-
Parameters
Returns unknown
-
Parameters
-
name: string
-
value: unknown
remove
-
Parameters
-
Optional selector: string
removeClass
- removeClass(): Cheerio
- removeClass(className: string): Cheerio
- removeClass(func: (index: number, className: string) => string): Cheerio
-
-
Parameters
-
Parameters
-
func: (index: number, className: string) => string
-
- (index: number, className: string): string
-
Parameters
-
index: number
-
className: string
Returns string
replaceWith
-
Parameters
-
Parameters
-
Parameters
-
Parameters
-
Parameters
serializeArray
- serializeArray(): { name: string; value: string }[]
-
Returns { name: string; value: string }[]
siblings
- siblings(selector?: string): Cheerio
-
Parameters
-
Optional selector: string
slice
- slice(start: number, end?: number): Cheerio
-
Parameters
-
start: number
-
Optional end: number
text
- text(): string
- text(text: string): Cheerio
-
Returns string
-
Parameters
toggleClass
- toggleClass(className: string): Cheerio
- toggleClass(className: string, toggleSwitch: boolean): Cheerio
- toggleClass(toggleSwitch?: boolean): Cheerio
- toggleClass(func: (index: number, className: string, toggleSwitch: boolean) => string, toggleSwitch?: boolean): Cheerio
-
Parameters
-
Parameters
-
className: string
-
toggleSwitch: boolean
-
Parameters
-
Optional toggleSwitch: boolean
-
Parameters
-
func: (index: number, className: string, toggleSwitch: boolean) => string
-
- (index: number, className: string, toggleSwitch: boolean): string
-
Parameters
-
index: number
-
className: string
-
toggleSwitch: boolean
Returns string
-
Optional toggleSwitch: boolean
val
- val(): string
- val(value: string): Cheerio
-
Returns string
-
Parameters
wrap
-
Parameters
-
Parameters
-
Parameters