Skip to main content
Version: 3.0

CheerioCrawlingContext <UserData, JSONData>

Hierarchy

  • InternalHttpCrawlingContext<UserData, JSONData, CheerioCrawler>
    • CheerioCrawlingContext

Index

Properties

$

$: CheerioAPI

The Cheerio object with parsed HTML. Cheerio is available only for HTML and XML content types.

body

body: string | Buffer

The request body of the web page. The type depends on the Content-Type header of the web page:

  • String for text/html, application/xhtml+xml, application/xml MIME content types
  • Buffer for others MIME content types

contentType

contentType: { encoding: BufferEncoding; type: string }

Parsed Content-Type header: { type, encoding }.


Type declaration

  • encoding: BufferEncoding
  • type: string

crawler

crawler: CheerioCrawler

enqueueLinks

enqueueLinks: (options?: CheerioCrawlerEnqueueLinksOptions) => Promise<BatchAddRequestsResult>

Type declaration

    • (options?: CheerioCrawlerEnqueueLinksOptions): Promise<BatchAddRequestsResult>
    • Parameters

      • optionaloptions: CheerioCrawlerEnqueueLinksOptions

      Returns Promise<BatchAddRequestsResult>

id

id: string

json

json: JSONData

The parsed object from JSON string if the response contains the content type application/json.

log

log: Log

optionalproxyInfo

proxyInfo?: ProxyInfo

An object with information about currently used proxy by the crawler and configured by the ProxyConfiguration class.

request

request: Request<UserData>

The original Request object.

response

response: IncomingMessage

sendRequest

sendRequest: (overrideOptions?: Partial<OptionsInit>) => Promise<Response<string>>

Type declaration

    • (overrideOptions?: Partial<OptionsInit>): Promise<Response<string>>
    • Parameters

      • optionaloverrideOptions: Partial<OptionsInit>

      Returns Promise<Response<string>>

optionalsession

session?: Session