After page.goto() resolves, call page.url() to get the page’s current URL. Use the returned response’s url() when you specifically need the URL associated with that navigation response; use redirectChain() to inspect the earlier redirected requests.
Get the current page URL after navigation
Page.goto() follows redirects and, when there are multiple, resolves with the response from the last redirect. Read the destination from the page after the navigation resolves:
As an Amazon Associate I earn from qualifying purchases.
const response = await page.goto('https://example.com');
const finalUrl = page.url();
console.log(finalUrl);
page.url() returns the page URL and is a shortcut for page.mainFrame().url(). It is the straightforward choice when you want to know where the browser page ended up. See the Puppeteer Page.url() API reference and Page.goto() API reference.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchChoose the right URL API for your need
Current page destination: page.url()
Use this for the page’s URL after navigation, including when you care about its current state rather than only the response that completed goto().
#1 Best Overall
Navigation response URL: response?.url()
goto() returns an HTTPResponse or null. If you need the URL attached to the response it returned, read that response’s URL:
const response = await page.goto('https://example.com');
const responseUrl = response?.url();
console.log(responseUrl);
Optional chaining avoids calling a method on a missing response. Puppeteer documents a null result for navigation to about:blank and for a same-URL navigation that changes only the hash. The response URL is provided by HTTPResponse.url().
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Earlier redirected requests: redirectChain()
For debugging, inspect the navigation response’s request chain. It lists requests that were redirected; it is history, not the final destination:
const response = await page.goto('http://example.com');
const redirects = response?.request().redirectChain() ?? [];
const finalUrl = page.url();
console.log('Redirected requests:', redirects.map(request => request.url()));
console.log('Final page URL:', finalUrl);
A single redirect from HTTP to HTTPS yields a chain containing the original HTTP request. With no redirects, the chain is empty. See HTTPRequest.redirectChain().
Rank #3
Check HTTP status separately
A completed navigation does not guarantee a successful HTTP status. Puppeteer notes that in headless shell, goto() does not throw for valid HTTP responses such as 404 or 500. If status matters, inspect it explicitly:
const response = await page.goto('https://example.com');
const finalUrl = page.url();
const status = response?.status();
console.log({ finalUrl, status });
An HTTP error response is different from a network or request failure: 404 and 503 are HTTP responses, not necessarily navigation exceptions. The Page.goto() reference documents navigation behavior, while HTTPRequest describes request handling.
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
Account for later client-side navigation
A page may change its URL through client-side navigation after the initial goto() has resolved. In that case, response.url() still identifies the response returned by the original navigation, while page.url() read later reflects the page’s current URL. If you need the post-navigation destination, wait for the relevant client-side navigation to finish before sampling page.url().
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Common issues and fixes
- Reading
response.url()throws:goto()can returnnullforabout:blankor same-URL hash navigation. Useresponse?.url()or readpage.url(). - The redirect chain appears empty: An empty chain means no redirected request was recorded. It does not mean the final URL is unavailable; read
page.url(). - The request completed but the site returned an error page: Check
response?.status(); navigation completion and an HTTP success status are separate checks. - The logged response URL differs from the page URL: The page may have navigated client-side after the original response. Read
page.url()after that later navigation completes.
Or skip the browser setup
If your goal is to capture the redirected destination as an image, ScreenshotNeo accepts a URL in one GET request and returns a screenshot. The same request pattern can capture the starting URL without configuring Puppeteer; the service produces a screenshot rather than exposing Puppeteer’s redirect-chain data.
Best Value
ScreenshotNeo API documentation
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
- Cookie and consent banners, newsletter popups and chat widgets are removed before capture; each cleanup step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed. Responses say which page verdict applied and whether it was billed.
- An MCP server provides
take_screenshot,get_page_infoandcapture_pdftools for AI agents and MCP clients. - 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 free.
Frequently Asked Questions
Does Puppeteer return the final redirect response from page.goto()?
Yes. For multiple redirects, goto() resolves with the response from the last redirect.
Is redirectChain() the final URL?
No. It returns the requests that were redirected; use page.url() for the current destination.
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.
Recommended Free Tools




