If you already have a Puppeteer HTTPRequest, call request.response(). It returns the matching HTTPResponse after one arrives, or null while the response is still pending. If a click or other action will cause the response, register page.waitForResponse() before performing that action, then await the response.
Get the response from an existing request
Use HTTPRequest.response() when you already hold the request object:
As an Amazon Associate I earn from qualifying purchases.
page.on('request', request => {
const response = request.response();
if (response) {
console.log(response.status(), response.url());
} else {
console.log('The response has not arrived yet');
}
});
The method is an accessor, not a waiter: its result can be null if called before the response arrives. The Puppeteer HTTPRequest API describes the result as a matching HTTPResponse object or null if the response has not been received.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Wait for a response caused by an action
For a response expected after a click, navigation, or other page action, use page.waitForResponse(). Start the wait first so Puppeteer is listening before the action can produce the response.
#1 Best Overall
const responsePromise = page.waitForResponse(response =>
response.url().includes('/api/data') &&
response.request().method() === 'GET'
);
await page.click('button#load-data');
const response = await responsePromise;
console.log('Status:', response.status());
console.log('Body:', await response.json());
The URL fragment and selector above are examples; replace them with the endpoint and control used by your page. A predicate can match on URL, status, method, or other response/request properties. The Puppeteer Page.waitForResponse reference documents URL and asynchronous-predicate matching.
Match the response you mean
Pages can make several requests at once. Match enough details to avoid resolving on an unrelated response, for example a distinctive URL and the outgoing method. If you know the expected status, include it too:
Rank #2
const responsePromise = page.waitForResponse(response =>
response.url() === 'https://example.com/api' &&
response.status() === 200
);
await page.click('#submit');
const response = await responsePromise;
Read status and body
After the promise resolves, HTTPResponse provides methods such as status(), ok(), url(), text(), and json(). Choose the body reader that matches the response content; json() requires a JSON response body.
Free tools Windows power users keep installed
One-click scans. No signup required.
Choose the API for the job
- Already have an
HTTPRequest: callrequest.response(); it may benulluntil the response arrives. - Need the outgoing request: use
page.waitForRequest(urlOrPredicate). It resolves to anHTTPRequest, whose response may still be pending. - Need the incoming response: use
page.waitForResponse(urlOrPredicate). - Need to observe all page traffic: listen for the page’s
requestandresponseevents.
See the official HTTPRequest reference and Page.waitForRequest reference for their respective lifecycle and return values.
Understand request and response lifecycle events
Puppeteer distinguishes when a request is issued, when a response arrives, and when the response body has finished downloading. The page’s request event supplies an HTTPRequest; response supplies an HTTPResponse; requestfinished marks completion of the request and body download. A request-level failure emits requestfailed instead of requestfinished and may occur without a response event. The Puppeteer Page events reference documents these events.
Do not confuse an HTTP error status with a transport-level failure. A 404 or 503 is still an HTTP response and, according to Puppeteer’s event documentation, completes through requestfinished, not requestfailed. Inspect response.status() or response.ok() to evaluate the HTTP result separately from whether the request failed at the request level. See the HTTPResponse reference.
Rank #4
Redirects create a new request
A redirect response completes the original request and causes a new request to the destination URL. If the final URL differs from the one you expected, inspect the request URLs and redirect chain rather than assuming the original request’s URL will identify the final response.
Timeouts and troubleshooting
The current Puppeteer Page.waitForResponse() reference is labeled version 25.12.0 and documents a default timeout of 30 seconds. The timeout can be changed with Page.setDefaultTimeout(), overridden with the wait’s timeout option, or disabled for a particular wait with timeout: 0. The API also accepts an abort signal. Check the installed Puppeteer version’s reference if your project uses a different release.
Best Value
| Symptom | Likely explanation | What to check |
|---|---|---|
request.response() returns null |
The response has not arrived when the accessor is called. | Wait with page.waitForResponse() when you need a future response, or handle the page’s response event. |
waitForResponse() times out |
No response matched the URL or predicate during the wait period, or the action did not initiate the expected request. | Register the wait before the trigger; confirm the action fires; check the actual URL, method, and predicate conditions. |
| The wait resolves on the wrong response | The predicate matches a different request made by the page. | Narrow it using a more specific URL, method, or expected status. |
| A request appears to fail despite an HTTP status | An HTTP error response and a request-level failure are different outcomes. | Inspect the response status separately; 404 and 503 responses are not themselves requestfailed events. |
| The final URL does not match the initial one | The server redirected the request and the browser issued a new request. | Inspect the redirect chain and the URLs of subsequent requests. |
Or skip the browser setup
If your goal is a screenshot or PDF rather than inspecting network traffic in your own Puppeteer session, ScreenshotNeo can return one from a GET request. Its API accepts the URL and can return PNG, JPEG, WebP, or PDF. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. It also offers an MCP server with screenshot, page-info, and PDF tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Does `page.waitForRequest()` give me the response?
No. It resolves to an `HTTPRequest`; use `page.waitForResponse()` to await an `HTTPResponse`.
Does a 404 trigger `requestfailed`?
No. Puppeteer treats 404 and 503 as HTTP responses that complete through `requestfinished`; check the response status to determine whether the HTTP result is successful.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




