Skip to content

How to get response headers #1239

@wh5938316

Description

@wh5938316

The return value of await page.goto is null. If I want to get the response headers of that website's document, how should I do it?

const response = await page.goto(url, { waitUntil: 'load', timeout: timeout });

// echo `null`
console.log(response);

// I want to get headers
const headers = response.headers();

I'm sure it's not due to a timeout, because the subsequent page.evaluate will execute normally.

Metadata

Metadata

Assignees

Labels

CDPChrome Debug Protocol

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions