browser
browser copied to clipboard
How to get response headers
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.
Hello @wh5938316, thanks for the issue. What library are you using? playwright?
I'm using puppeteer@^24.4.0; I haven't tried Playwright.