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 →Call handle.toString() to get a string representation of the Puppeteer handle itself. That representation is useful for debugging; it is not the text of the element or a general-purpose serialization of the object. To retrieve page content, evaluate a function on the handle instead.
Get the handle’s string representation
Use toString() directly:
const description = handle.toString();
console.log(description);
Puppeteer documents this as a debugging aid. The returned representation describes the handle, not necessarily the value you want to extract from the page. See the Puppeteer JSHandle API.
As an Amazon Associate I earn from qualifying purchases.
Get the value behind the handle instead
Choose the method according to the output you need. These examples assume you already have a Puppeteer handle.
| Need | Use | Example |
|---|---|---|
| A string representation of the handle, typically for debugging | toString() |
handle.toString() |
| Text or another selected value from the referenced page object | evaluate() |
await handle.evaluate(el => el.textContent) |
| Serializable portions of the referenced value | jsonValue() |
await handle.jsonValue() |
| A result that should remain an in-page handle | evaluateHandle() |
await page.evaluateHandle(() => document.body) |
Read an element’s text or attribute
For an element handle, evaluate a function with the element as its argument, then return the property you need:
#1 Best Overall
const text = await elementHandle.evaluate(el => el.textContent);
const title = await elementHandle.evaluate(el => el.getAttribute('title'));
Use textContent when you want the text content represented in the DOM. If you specifically need rendered, human-visible text, innerText may be a better fit:
const visibleText = await elementHandle.evaluate(el => el.innerText);
Retrieve serializable data
jsonValue() returns serializable portions of the referenced value. Puppeteer notes that it does not call the referenced object’s toJSON() method, so do not assume custom JSON conversion will be applied.
Rank #2
const value = await handle.jsonValue();
Choose between a returned value and a continuing handle
page.evaluate() returns the result of the page-side function. page.evaluateHandle() instead wraps the result as a handle that you can continue using in the page context. Use the latter when you need to keep a reference rather than just receive a value. See the Puppeteer page API reference.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesRelease handles when finished
A handle keeps its referenced object from being garbage-collected until the handle is disposed. Puppeteer also documents automatic disposal when the associated frame navigates or the parent execution context is destroyed. When you are done with a handle, release it explicitly:
await handle.dispose();
Do not use the handle after disposal. If a navigation or context destruction has already invalidated it, acquire a fresh handle from the current page context.
Troubleshooting
toString()does not show the element’s text: That is expected; it represents the handle. Read text withawait elementHandle.evaluate(el => el.textContent).jsonValue()does not produce the custom JSON shape you expected: Puppeteer does not call the referenced object’stoJSON()method. Explicitly construct and return the fields you need insideevaluate().- A handle fails after navigation or context destruction: Puppeteer automatically disposes handles in these situations. Query the page again to obtain a new handle.
- You no longer need a handle: Call
dispose()so its referenced object is no longer retained by that handle.
Or skip the browser setup
If the end goal is a screenshot rather than inspecting a Puppeteer value, ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return an image or PDF; the example below saves a WebP capture. See the ScreenshotNeo API documentation.
Quick Recap
Best Value
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups and chat widgets before capture. Bot checks, blank pages and failed loads are not billed; its MCP server lets AI agents take screenshots; and the Free plan includes 1,000 screenshots a month with no card, while paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month—no card required.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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.




