What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
After navigating with page.goto(), call response.request().redirectChain() to get the earlier requests in that resource’s redirect chain. The final navigation response is not a list of every hop, and page.goto() can return null for special navigations such as about:blank or a same-URL navigation that changes only the hash.
Get the redirect chain after navigation
Puppeteer’s HTTPRequest.redirectChain() returns the requests that preceded the current request in the same resource chain. With no redirect, it returns an empty array. For example, an HTTP-to-HTTPS redirect includes the original HTTP request.
As an Amazon Associate I earn from qualifying purchases.
const response = await page.goto('http://example.com');
if (response) {
const chain = response.request().redirectChain();
console.log('Redirect count:', chain.length);
console.log('Earlier request URLs:', chain.map(request => request.url()));
}
Check for a null response before calling request(). When there is a response, the chain contains the earlier requests; the response returned by page.goto() corresponds to the last redirect response. The chain lists predecessor requests, so inspect the final response URL separately if you need the destination.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →These APIs are documented in Puppeteer 25.12.0 documentation; the standalone redirectChain() page identifies version 25.10.0. Documentation labels can change, so check the API reference corresponding to the version installed in your project: redirectChain(), page.goto().
#1 Best Overall
Log redirects and other network activity as it happens
Use page events when you need to see requests and responses as navigation proceeds, rather than only examining the chain after goto() resolves. Puppeteer listens for requests and responses by default; adding event handlers makes the activity visible in your own logs.
page.on('request', request => {
console.log('request', request.method(), request.url());
});
page.on('response', response => {
console.log('response', response.status(), response.url());
});
page.on('requestfailed', request => {
console.log('failed', request.url(), request.failure()?.errorText);
});
const response = await page.goto(url);
if (response) {
const chain = response.request().redirectChain();
console.log('redirects', chain.map(request => request.url()));
}
A page issues requests for its document and many other resources. If you only want top-level navigation, filter request events with request.isNavigationRequest(); otherwise, unrelated images, scripts, and other resource requests can make the log noisy.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
A redirect is not inherently a failed request: the redirect response completes the current request, then the browser issues another request. Puppeteer emits requestfinished for a completed request, including a redirecting one. A requestfailed event indicates a request failure such as a timeout, not merely an HTTP error status.
Distinguish HTTP error statuses from request failures
An HTTP 404 or 503 is still a completed HTTP exchange. It does not, by itself, trigger requestfailed. Check the response status to detect an unsuccessful HTTP result, and use requestfailed to diagnose transport or loading failures.
Rank #3
page.on('response', response => {
if (response.request().isNavigationRequest()) {
console.log('navigation status', response.status(), response.url());
}
});
page.on('requestfailed', request => {
console.error('request failed', request.url(), request.failure()?.errorText);
});
The Puppeteer network logging guide documents request and response listeners. Event and request behavior is covered in the HTTPRequest API.
Verify a redirect visually in Chrome DevTools
For a manual cross-check, open Chrome DevTools’ Network panel before navigating so it records the requests. Review the request table’s status and initiator information; the initiator type can identify a redirect and show how one request led to another. This is useful for a visual investigation, while redirectChain() is the direct way to obtain predecessor URLs in code.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
See Chrome’s Network panel documentation for its request table and initiator details.
When the higher-level API is not enough
Puppeteer’s CDPSession can send Chrome DevTools Protocol commands and receive protocol events. Use it when you have a specific need that the request chain and page events do not cover; for ordinary redirect tracing, the higher-level APIs are simpler. Puppeteer warns that direct access to an HTTPRequest’s client can break Puppeteer, so avoid relying on that internal access for routine logging. See the CDPSession API.
Best Value
Troubleshoot missing or confusing redirect data
responseis null: Do not callresponse.request(). Puppeteer documents null responses for navigation toabout:blankand same-URL navigation that changes only the hash.- The chain is empty: That means there were no preceding requests in that resource chain. Confirm that the navigation URL actually redirects; if it does not, an empty array is expected.
- You see only the destination in the result: The response from
page.goto()is for the last redirect response. Callresponse.request().redirectChain()to inspect preceding requests. - The log contains many URLs: Page events include subresources as well as navigation. Filter on
request.isNavigationRequest()when you only need requests driving frame navigation. - A 404 or 503 is logged as a response, not a failure: That is expected. Inspect
response.status()for HTTP status; reserverequestfailedfor failures such as timeouts. - No request appears in DevTools: The Network panel records requests while it is open. Open it before triggering navigation.
Or skip the browser setup
If you need a screenshot of a URL rather than a Puppeteer redirect trace, ScreenshotNeo returns a screenshot or PDF with one GET request. Its clean-shot steps accept cookie and consent banners like a visitor, then remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents.
For example, using cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card.
Frequently Asked Questions
Does redirectChain() include the final URL?
It returns requests preceding the current request in the chain; the final navigation response’s URL is available from the response itself.
Do I need request interception to trace redirects?
No. Use the navigation response’s request chain or page request and response events for ordinary redirect tracing.
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.




