The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →After navigating to the page, call and await page.title(). It returns the page title as a string:
const title = await page.title();
console.log(title);
This is Puppeteer’s dedicated method for retrieving a page title. It does not require selecting a <title> element or evaluating JavaScript in the page.
As an Amazon Associate I earn from qualifying purchases.
Get a page title with Puppeteer
Here is a complete JavaScript example using Puppeteer’s standard launch, page creation, and navigation flow:
Free tools Windows power users keep installed
One-click scans. No signup required.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com');
const title = await page.title();
console.log(title);
} finally {
await browser.close();
}
Run it in a JavaScript environment configured for ES module imports and top-level await. The official getting-started guide also describes importing puppeteer-core in place of puppeteer when that package suits your setup. The title method is documented as title(): Promise<string> and as a shortcut for page.mainFrame().title().
#1 Best Overall
Why the order matters
- Open a page with
await browser.newPage(). - Navigate to the destination with
await page.goto(url). - Read the title with
await page.title(). - Close the browser when the work is done.
Await the title call because it returns a Promise. Await navigation first when you want the destination page’s title, rather than reading before navigation has completed.
When to use the alternatives
page.title() is the clearest option when all you need is the title. The alternatives are useful when title retrieval is part of a different kind of page operation.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
| Method | Example | When it fits | Important behavior |
|---|---|---|---|
| Dedicated title method | await page.title() |
You want the page title as a string. | Returns a Promise of a string. |
| Page-context evaluation | await page.evaluate(() => document.title) |
You are already evaluating page-context state or combining the title with other DOM work. | page.evaluate() runs the function in the page context and returns its result; it also awaits a Promise returned by that function. |
| Selector evaluation | await page.$eval('title', el => el.textContent) |
You specifically need to select the matching element and process it. | $eval() uses the first matching element and throws if there is no match. |
Troubleshoot title retrieval
- The value is not for the destination page: make sure the script awaits
page.goto(url)before callingpage.title(). - The result is not available immediately: await the call:
const title = await page.title(). Its documented return type is a Promise. $eval()throws: the selector-based method throws when it finds no matchingtitleelement. Usepage.title()for straightforward title retrieval, or handle the selector failure if selecting the element is essential.- You are using
page.evaluate()only to read the title: switch topage.title()for the direct, dedicated API. Keep evaluation when you need a larger page-context computation.
Performance and operational notes
For a title alone, page.title() avoids the extra selector-oriented code of $eval() and the broader page-context machinery of evaluate(). The documented API describes the method and its Promise return type, but does not provide comparative performance measurements; there is no sourced benchmark to claim one approach is faster.
Recommended Free Tools
The browser lifecycle in the example uses try/finally so the browser-close call runs even if work inside the block fails. This is ordinary JavaScript cleanup structure, not a Puppeteer-specific guarantee about recovery from every possible launch or navigation failure.
Rank #3
- 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
Or skip the browser setup
If your actual goal is to capture a page image or PDF rather than read its title, ScreenshotNeo can return a capture with one GET request. It is not a replacement for page.title(): the endpoint returns a screenshot or PDF, not the title string.
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 for request options. ScreenshotNeo accepts cookie or 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 identify the page verdict and billing status. Its MCP server provides screenshot tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Quick Recap
Best Value
Rank #4
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.




