Home Reference Source
import PuppeteerRequestCapturer from 'node-warc/lib/requestCapturers/puppeteer.js'
public class | source

PuppeteerRequestCapturer

Puppeteer Request Capturer

Constructor Summary

Public Constructor
public

constructor(page: Page, requestEvent: string)

Member Summary

Private Members
private

To Capture Requests Or Not To Capture Requests

private
private

A list of requests made

Method Summary

Public Methods
public

Get An Iterator Over The Requests Captured

public

attach(page: Page, requestEvent: string)

Attach (start listening for request events) the request capturerer to the page object

public

clear()

Remove All Requests

public

detach(page: Page, requestEvent: string)

Detach (stop listening for request events) the request capturerer from the page object

public
public
public
public

Sets an internal flag to begin capturing network requests.

public

Sets an internal flag to stop the capturing network requests

Public Constructors

public constructor(page: Page, requestEvent: string) source

Params:

NameTypeAttributeDescription
page Page
  • optional
  • nullable: true

The puppeteer page object

requestEvent string
  • optional
  • default: 'request'

Private Members

private _capture: boolean source

To Capture Requests Or Not To Capture Requests

private _requestC: number source

private _requests: Map<int, Request> source

A list of requests made

Public Methods

public [Symbol.iterator](): Iterator<Request> source

Get An Iterator Over The Requests Captured

Return:

Iterator<Request>

See:

public attach(page: Page, requestEvent: string) source

Attach (start listening for request events) the request capturerer to the page object

Params:

NameTypeAttributeDescription
page Page

The puppeteer page object

requestEvent string
  • optional
  • default: 'request'

public clear() source

Remove All Requests

public detach(page: Page, requestEvent: string) source

Detach (stop listening for request events) the request capturerer from the page object

Params:

NameTypeAttributeDescription
page Page

The puppeteer page object

requestEvent string
  • optional
  • default: 'request'

public iterateRequests(): Iterator<Request> source

Return:

Iterator<Request>

public requestWillBeSent(r: Request) source

Params:

NameTypeAttributeDescription
r Request

public requests(): Array<Request> source

Return:

Array<Request>

public startCapturing() source

Sets an internal flag to begin capturing network requests. Clears Any Previously Captured Request Information

public stopCapturing() source

Sets an internal flag to stop the capturing network requests