getProfiles()
Get a list of all available browser profile labels.Signature
Returns
Array of profile names that can be used with thebrowser option.
Example
Using a random profile
getOperatingSystems()
Get a list of all available operating systems for emulation.Signature
Returns
Array of OS names that can be used with theos option.
Example
Combining browser and OS
Headers
TheHeaders class for working with HTTP headers.
Constructor
Methods
append(name, value): add a header valuedelete(name): remove a headerget(name): get a header valuehas(name): check if header existsset(name, value): set a header valueentries(): iterate over header entrieskeys(): iterate over header namesvalues(): iterate over header values
Example
Response
TheResponse class representing HTTP responses.
Properties
status: HTTP status codestatusText: HTTP status textheaders: response headersok:trueif status is 200-299url: final URL after redirectsredirected:trueif the response is the result of a redirectbody:ReadableStream<Uint8Array>ornullbodyUsed:trueif body has been readcontentLength: content length from headers, ornullcookies: parsed response cookies asRecord<string, string | string[]>
Methods
json(): parse body as JSONtext(): get body as stringarrayBuffer(): get body as ArrayBufferblob(): get body as BlobformData(): parse body as FormDataclone(): clone the response