Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • AxiosResponse
  • CheerioSelector
  • CheerioAPI
    • Response

Callable

  • __call(selector: string): Cheerio
  • __call(selector: string, context: string): Cheerio
  • __call(selector: string, context: CheerioElement): Cheerio
  • __call(selector: string, context: CheerioElement[]): Cheerio
  • __call(selector: string, context: Cheerio): Cheerio
  • __call(selector: string, context: string, root: string): Cheerio
  • __call(selector: string, context: CheerioElement, root: string): Cheerio
  • __call(selector: string, context: CheerioElement[], root: string): Cheerio
  • __call(selector: string, context: Cheerio, root: string): Cheerio
  • __call(selector: any): Cheerio
  • __call(selector: string): Cheerio
  • __call(selector: string, context: string): Cheerio
  • __call(selector: string, context: CheerioElement): Cheerio
  • __call(selector: string, context: CheerioElement[]): Cheerio
  • __call(selector: string, context: Cheerio): Cheerio
  • __call(selector: string, context: string, root: string): Cheerio
  • __call(selector: string, context: CheerioElement, root: string): Cheerio
  • __call(selector: string, context: CheerioElement[], root: string): Cheerio
  • __call(selector: string, context: Cheerio, root: string): Cheerio
  • __call(selector: any): Cheerio
  • Parameters

    • selector: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement[]

    Returns Cheerio

  • Parameters

    • selector: string
    • context: Cheerio

    Returns Cheerio

  • Parameters

    • selector: string
    • context: string
    • root: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement
    • root: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement[]
    • root: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: Cheerio
    • root: string

    Returns Cheerio

  • Parameters

    • selector: any

    Returns Cheerio

  • Parameters

    • selector: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement[]

    Returns Cheerio

  • Parameters

    • selector: string
    • context: Cheerio

    Returns Cheerio

  • Parameters

    • selector: string
    • context: string
    • root: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement
    • root: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: CheerioElement[]
    • root: string

    Returns Cheerio

  • Parameters

    • selector: string
    • context: Cheerio
    • root: string

    Returns Cheerio

  • Parameters

    • selector: any

    Returns Cheerio

Index

Properties

config

config: AxiosRequestConfig

crawler

crawler: Crawler

The crawler instance.

data

data: T

headers

headers: any

Optional request

request: any

status

status: number

statusText

statusText: string

times

times: number

How many times(ms) it takes.

Methods

contains

  • contains(container: CheerioElement, contained: CheerioElement): boolean
  • Parameters

    • container: CheerioElement
    • contained: CheerioElement

    Returns boolean

download

  • download(url: string, filepath: string, options?: DownloadOptions): Promise<void>
  • Download the resource

    Parameters

    • url: string

      The resource url

    • filepath: string

      The filepath which is the resource downloaded

    • Optional options: DownloadOptions

    Returns Promise<void>

downloadInQueue

  • downloadInQueue(url: string, filepath: string, options?: DownloadOptions): void
  • Download the resource in queue

    Parameters

    • url: string

      The resource url

    • filepath: string

      The filepath which is the resource downloaded

    • Optional options: DownloadOptions

    Returns void

follow

  • follow(url: Url): void

html

  • html(options?: CheerioOptionsInterface): string
  • html(selector: string, options?: CheerioOptionsInterface): string
  • html(element: Cheerio, options?: CheerioOptionsInterface): string
  • html(element: CheerioElement, options?: CheerioOptionsInterface): string
  • Parameters

    • Optional options: CheerioOptionsInterface

    Returns string

  • Parameters

    • selector: string
    • Optional options: CheerioOptionsInterface

    Returns string

  • Parameters

    • element: Cheerio
    • Optional options: CheerioOptionsInterface

    Returns string

  • Parameters

    • element: CheerioElement
    • Optional options: CheerioOptionsInterface

    Returns string

load

  • load(html: string | Buffer, options?: CheerioOptionsInterface): CheerioStatic
  • load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic
  • Parameters

    • html: string | Buffer
    • Optional options: CheerioOptionsInterface

    Returns CheerioStatic

  • Parameters

    • element: CheerioElement
    • Optional options: CheerioOptionsInterface

    Returns CheerioStatic

parseHTML

  • parseHTML(data: string, context?: Document, keepScripts?: boolean): Document[]
  • Parameters

    • data: string
    • Optional context: Document
    • Optional keepScripts: boolean

    Returns Document[]

retry

  • retry(): void

root

  • root(): Cheerio
  • Returns Cheerio

xml

  • xml(): string
  • Returns string