iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Call response.url() on a Puppeteer HTTPResponse. It returns the response URL as a string. For navigation, check that page.goto() did not return null before calling the method.
Get a response URL
HTTPResponse.url() is the method for reading the URL associated with a response:
const url = response.url();
console.log(url);
It is synchronous: do not use await. The official Puppeteer API reference describes it as returning the URL of the response, with a string return type.
Outdated 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 matchWindows 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 reinstallRead the URL returned by page.goto()
page.goto() resolves to the main navigation resource’s response, or null in documented cases. Guard against null before reading its URL:
#1 Best Overall
const response = await page.goto('https://example.com');
if (response) {
console.log(response.url());
}
The navigation result can be null when navigating to about:blank or to the same URL with only a different hash. See the Page.goto() API reference for its return behavior.
Get the final URL and inspect redirects
When navigation follows redirects, page.goto() resolves with the response for the last redirect. Therefore, response.url() gives the final response URL, not the original address you passed to page.goto().
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
const response = await page.goto('http://example.com');
if (response) {
console.log('Response URL:', response.url());
const redirects = response.request().redirectChain();
console.log('Redirected from:', redirects.map(request => request.url()));
}
The redirect chain contains the earlier requests in the sequence; the final response’s request is not itself an earlier redirect. With no redirects, the chain is empty. For a request URL, use HTTPRequest.url(); for the response URL, use HTTPResponse.url(). The redirectChain() API reference documents the chain.
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 →Handle status codes and missing responses
- Navigation returned
null: there is no response object and thus no response URL to read. Check the value before callingurl(). - Response status is 404 or 500: an HTTP error status can still come with a response. Read its URL normally, and call
response.status()if you also need to check the status. - You need the original URL before redirects: inspect
response.request().redirectChain()and map each request to itsurl(). The returned response URL alone identifies the final response.
Or skip the browser setup
If your goal is a screenshot rather than Puppeteer response metadata, ScreenshotNeo can capture a page with one GET request. Its API also provides response verdict and billing headers; it is not a replacement for Puppeteer’s HTTPResponse.url() when you need the navigation response URL.
Quick Recap
Best Value
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
Rank #3
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation. Cookie banners, newsletter popups and chat widgets are removed before capture; bot checks, blank pages and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Learn about ScreenshotNeo, or sign up for the free plan.
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.

