Free tools Windows power users keep installed
One-click scans. No signup required.
A Puppeteer JavaScript handle is a reference to an object inside the page—not a copy of that object in Node.js. Use page.evaluate() when you need serializable data; use page.evaluateHandle() when you need to keep working with a page-side object, especially a DOM element. Dispose handles when finished.
What is a JSHandle in Puppeteer?
A JSHandle is a Node-side wrapper around an object that lives in the browser page’s JavaScript context. It lets automation refer to that object without serializing it into a plain value. A handle keeps its referenced object from being garbage-collected until the handle is disposed or its execution context is destroyed. See the JSHandle API reference.
Handles are useful when the next operation needs the object itself: for example, to inspect a page-side object, obtain one of its properties, or work with a DOM node. They are not ordinary Node.js objects, so reading a handle does not directly give you the referenced value.
Should you use evaluate() or evaluateHandle()?
| Method | What you get | Use it when |
|---|---|---|
page.evaluate() |
A result serialized from the page context into Node.js. | You need a value such as text, a number, or a plain data object. |
page.evaluateHandle() |
A JSHandle for a page-side object, or an ElementHandle when the result is a DOM element. |
You need to retain the object reference for follow-up work or use element-specific operations. |
For example, returning a DOM node with evaluate() does not preserve the node as a usable reference; serialization may yield an empty object. Use evaluateHandle() for the node itself. Use evaluate() if you only need a serializable result such as the node’s text. Puppeteer’s JavaScript execution guide explains the evaluation context and serialization behavior.
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 reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
How to create and use a JavaScript handle
This example gets the page’s body element as a handle, reads its HTML in the page context, and releases the handle afterward:
const bodyHandle = await page.evaluateHandle(() => document.body);
const html = await bodyHandle.evaluate(body => body.innerHTML);
console.log(html);
await bodyHandle.dispose();
The function passed to evaluation executes in the page, not in your Puppeteer script’s lexical scope. It cannot access local Node.js variables or functions by closing over them. Pass values as arguments instead:
const prefix = 'Welcome';
const headingText = await page.evaluate(
prefix => `${prefix}: ${document.querySelector('h1')?.textContent ?? ''}`,
prefix,
);
Values needed in the page must be serializable arguments. Promises returned by the page function are awaited by Puppeteer. For API details, see Page.evaluateHandle().
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
How to get an ElementHandle and use element methods
ElementHandle extends JSHandle and adds operations specific to DOM elements. If evaluateHandle() returns an element, Puppeteer represents it as an ElementHandle. You can then call element methods such as click():
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
const buttonHandle = await page.evaluateHandle(() =>
document.querySelector('button[type="submit"]'),
);
if (!buttonHandle.asElement()) {
await buttonHandle.dispose();
throw new Error('Submit button was not found');
}
await buttonHandle.click();
await buttonHandle.dispose();
The example checks that the result is an element before calling click(). A selector that matches nothing returns null, so evaluateHandle() in that case does not give you a usable element. Prefer Puppeteer’s locator or selector APIs when they suit the task; handles are particularly useful when you already have a page-side object reference. See the ElementHandle API reference.
How to inspect, pass, and convert handles
You can pass a handle into another evaluation, or use handle methods to inspect or convert the referenced object. The most relevant methods include:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
handle.evaluate(fn, ...args)runs a function with the referenced object as its first argument and returns a serialized result.handle.evaluateHandle(fn, ...args)runs a function against the referenced object and returns another handle.handle.getProperty(name)returns a handle for one property.handle.getProperties()returns a map of property names to handles.handle.jsonValue()returns the serializable portions of the referenced object.handle.asElement()returns the same handle as anElementHandleif it represents a DOM element, ornullotherwise.handle.dispose()releases the referenced object.
For example, this reads a property using a child handle and disposes both handles:
const settingsHandle = await page.evaluateHandle(() => window.appSettings);
const themeHandle = await settingsHandle.getProperty('theme');
try {
const theme = await themeHandle.jsonValue();
console.log(theme);
} finally {
await themeHandle.dispose();
await settingsHandle.dispose();
}
Property handles returned from getProperty() or getProperties() have their own lifetimes. Dispose of any property handles you retain. The getProperties() reference describes its returned map.
When should you use jsonValue()?
Use jsonValue() when you want serializable data from an existing handle rather than continued access to the page-side object. It does not invoke a custom toJSON method, and it can throw if the value is circular. It also cannot turn a DOM node into a useful Node-side element reference; use an ElementHandle for DOM operations. See JSHandle.jsonValue().
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
When and how should you dispose handles?
Call dispose() once you no longer need a handle. Disposal releases the referenced object so it can be garbage-collected. Puppeteer also automatically disposes handles when their frame navigates or the parent execution context is destroyed, but that is not a substitute for cleaning up handles during normal control flow. See JSHandle.dispose().
Use try/finally when intermediate work might throw, so cleanup still happens:
const titleHandle = await page.evaluateHandle(() => document.querySelector('title'));
try {
const title = await titleHandle.evaluate(el => el?.textContent ?? '');
console.log(title);
} finally {
await titleHandle.dispose();
}
Do not dispose a handle before the final operation that uses it. If a handle has already been released, later attempts to use it cannot access the page-side object.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Common handle errors and fixes
- You receive
{}for a DOM node:evaluate()serializes its return value. UseevaluateHandle()when you need the DOM node reference, or return a serializable property such astextContent. - A page function cannot see a Node variable: page functions run in the browser context and do not close over Node-side variables. Pass the value as an evaluation argument.
asElement()returnsnull: the handle does not represent a DOM element, or the page expression returnednull. Check the result before calling element methods.- A handle is no longer usable after navigation: navigation destroys the relevant page context and Puppeteer disposes its handles. Locate or create a fresh handle in the new document.
- Handle use fails after cleanup: verify that
dispose()has not already been called and that cleanup runs only after the last operation needing the handle. - Property inspection leaves many handles around: values from
getProperties()are handles too. Dispose of the property handles you keep, as well as the parent handle when finished.
Or skip the browser setup
If your goal is a screenshot rather than interactive page automation, ScreenshotNeo provides a website screenshot API. Its one-call request can return a screenshot without you setting up Puppeteer:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. It accepts cookie and consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up free for ScreenshotNeo.
Frequently Asked Questions
What is the difference between a JSHandle and an ElementHandle?
A JSHandle can refer to a general page-side JavaScript object. An ElementHandle is the specialized handle for a DOM element and provides element-specific operations.
Does evaluateHandle() return a JSHandle or an ElementHandle?
It returns a handle; when the returned page-side object is a DOM element, Puppeteer represents it as an ElementHandle.
Recommended Free Tools
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.

