If page.url() reports about:blank, the page’s main frame is still at its initial blank document—or you may be checking a different page or frame than the one that navigated. Await the navigation, then read the URL from the same Puppeteer Page. The method is an accessor; it does not navigate or wait on its own.
First, identify what “blank” means
Log the exact value rather than checking only whether it is truthy:
As an Amazon Associate I earn from qualifying purchases.
console.log({ current: page.url() });
Puppeteer documents page.url() as the page URL and a shortcut for page.mainFrame().url(). Its documented model represents the initial blank document as about:blank; the API reference does not describe url() as returning an empty string. If your output is empty, undefined, or missing, check the surrounding application code and logging separately from Puppeteer navigation.
See the Puppeteer Page API reference.
Wait for direct navigation before reading the URL
For a direct navigation, include the URL scheme and await page.goto() before calling page.url():
#1 Best Overall
const response = await page.goto('https://example.com');
console.log({
requested: 'https://example.com',
current: page.url(),
status: response?.status(),
});
goto() performs the navigation; url() reads the current main-frame URL. Puppeteer documents the goto() URL parameter as including a scheme, such as https://. It resolves to the main resource response, or can return null in specified cases. See the Puppeteer Page.goto() API reference.
Wait safely for navigation triggered by a click
When a click causes navigation, start waiting before clicking. Otherwise, the navigation can happen before the wait is registered:
const [response] = await Promise.all([
page.waitForNavigation(),
page.click('a.navigate'),
]);
console.log({ current: page.url(), status: response?.status() });
Puppeteer documents this Promise.all() pattern for avoiding the race between an action and its navigation wait. See the Puppeteer Page.waitForNavigation() API reference.
Handle single-page app URL changes
A single-page application may change the URL through the History API without loading a new document. Puppeteer counts a History API URL change as navigation for waitForNavigation(). Start the wait before the action that triggers the change, then inspect page.url() after the wait resolves:
const [response] = await Promise.all([
page.waitForNavigation(),
page.click('button.change-route'),
]);
console.log({ current: page.url(), status: response?.status() });
For a particular app, make sure the action actually changes the URL; a click or UI update alone does not establish that a URL change occurred.
Check whether you are inspecting the right page or frame
- Popup or new tab:
page.url()reports the main-frame URL for that specificPage. If a link opened another page, inspect that page rather than assuming the original page changed. - Iframe:
page.url()reports the top-level page’s main-frame URL, not an iframe’s URL. Inspect the relevant frame if the destination is inside an iframe. - Different page object: Confirm that the object passed to
url()is the same one passed togoto(), or the one associated with the click and navigation wait.
The Page API describes url() as a shortcut for the main frame’s URL. It cannot determine which object your application intended to inspect.
Rank #3
Interpret redirects and a null navigation response
A requested URL and the final URL after redirects can differ. Check page.url() after navigation to read the current main-frame URL rather than assuming it must equal the original request.
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 →A null result from goto() does not by itself mean navigation failed. Puppeteer documents that navigation to about:blank, or to the same URL with a different hash, succeeds and returns null. Treat the navigation response and the current URL as separate pieces of information. See the goto() documentation.
Investigate browser-level errors only when the error matches
If the destination is remote HTTP and navigation reports net::ERR_BLOCKED_BY_CLIENT, consult Puppeteer’s troubleshooting guide for the documented Chrome for Testing behavior and workaround. Confirm that this specific error is present before applying a launch-flag change; it is not a general fix for every about:blank result.
Rank #4
Or skip the browser setup
If you need a screenshot rather than a Puppeteer debugging workflow, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return an image or PDF; the example below saves a WebP screenshot. See the ScreenshotNeo documentation for API options.
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://example.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 of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsSign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does page.url() return the URL of an iframe?
No. It returns the URL of the page’s main frame. Inspect the relevant frame when the destination is inside an iframe.
Best Value
Does page.url() wait for navigation?
No. It reads the current URL. Await goto() for direct navigation, or register waitForNavigation() before the action that triggers navigation.
Does a null response from page.goto() always mean navigation failed?
No. Puppeteer documents successful navigation to about:blank and same-URL hash changes as cases where goto() returns null.
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 →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.




