onassar
onassar

Reputation: 3568

Access response headers from all requests using Puppeteer

I have a functioning script up and running, but am having trouble figuring out how to iterate over all the requests that took place during a goto call.

I simply want to iterate over them, and access their response headers (to look for cookie and timestamp information). I have no interest in aborting or continuing requests (as I've seen other code examples focus on). I simply want the headers.

Anyone run into this?

Upvotes: 0

Views: 969

Answers (1)

Tamás Sallai
Tamás Sallai

Reputation: 3365

Seems like you can use page.on('response') to get all the network responses. Here's an article that describes it: https://blog.ramosly.com/how-ive-been-using-puppeteer-b8010e374ff7

Upvotes: 1

Related Questions