Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

To screenshot an element inside an open shadow root, locate it with Puppeteer’s deep selector and call ElementHandle.screenshot(). For example, my-widget >>> .target finds a descendant inside an open shadow root beneath my-widget. If you need the whole rendered page rather than one internal element, use page.screenshot() instead; it does not require traversing the shadow tree.

Choose a page screenshot or an element screenshot

Use page.screenshot() when the desired output is the rendered page. Use ElementHandle.screenshot() when you need a particular element, such as a component’s internal panel. The latter requires finding that element and obtaining its handle first.

What you need Method Shadow-DOM lookup required? Important detail
Whole rendered page page.screenshot() No Set options such as fullPage when needed.
One element inside an open shadow root elementHandle.screenshot() Yes Find the element using >>> or >>>>, then screenshot its handle.
One element with awkward selector requirements page.evaluateHandle(), then elementHandle.screenshot() Yes Use page-context DOM access and check that the returned handle is non-null.

Screenshot an element in an open shadow root with a deep selector

Puppeteer adds the >>> and >>>> selector combinators because ordinary CSS selectors do not descend into Shadow DOM. These combinators are documented for open shadow roots.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Navigate to the page and wait until the component has rendered.
  2. Use a deep selector to find the internal element.
  3. Check that a handle was returned, then call screenshot() on it.
const target = await page.waitForSelector('my-widget >>> .target');
if (!target) {
  throw new Error('Target element not found');
}
await target.screenshot({ path: 'target.png' });

Here, my-widget is the host element and .target is a descendant in its open shadow tree. Use >>>> when the target is in the host’s immediate shadow root:

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
const target = await page.waitForSelector('my-widget >>>> .target');
if (!target) {
  throw new Error('Target element not found');
}
await target.screenshot({ path: 'target.png' });

The deep combinators can search through open shadow roots below the host. Do not assume they can traverse a closed shadow root.

Use page-context DOM access when selector composition is inconvenient

If you cannot conveniently express the lookup with a deep selector, use page.evaluateHandle() to access the host’s open shadowRoot and return the internal element’s handle. Then screenshot that handle:

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
const target = await page.evaluateHandle(() => {
  const host = document.querySelector('my-widget');
  return host?.shadowRoot?.querySelector('.target') ?? null;
});
if (!target) {
  throw new Error('Target element not found');
}
await target.screenshot({ path: 'target.png' });

This approach uses page-context DOM access, so it still depends on the root being open. Check for a missing host or element before calling screenshot().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture the whole page without selecting through Shadow DOM

If the page’s rendered appearance is what matters, you do not need a selector into the shadow tree:

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
await page.screenshot({ path: 'page.png', fullPage: true });

fullPage: true requests a full-page capture. For a viewport-sized capture, omit that option or set it to false.

Account for scrolling and rendering state

  • Wait for the component. Start selection after navigation and after the custom element has rendered its internal content. Otherwise, the selector may not find the target.
  • Expect element capture to scroll. Puppeteer’s element screenshot operation scrolls the target into view if needed. That can affect page state or the appearance of sticky and fixed elements. Inspect the output in the target environment.
  • Use the right scope. A page screenshot captures the rendered page without selecting the shadow-internal node; an element screenshot captures the chosen element.
  • Check the installed version. Puppeteer’s documentation identified for this method is version 25.12.0. Verify the current API signatures against the version installed in your project if it differs.

Troubleshoot missing or incorrect captures

The selector returns no element

Confirm the host name and internal selector, and make sure the component has rendered before looking for its target. Check for a missing handle before invoking screenshot(); otherwise, selection failure can become an operation error.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

The target is in a closed shadow root

The documented deep combinators apply to open shadow roots. The reviewed Puppeteer guidance does not establish traversal into closed roots. If you only need the visible page output, use page.screenshot() instead of selecting an internal node.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The element image changes the page’s visual state

Element screenshotting scrolls the target into view when necessary. If sticky or fixed content looks different, inspect the resulting image in the same environment and state in which the capture will run.

You need the page, not the internal element

Use page.screenshot() with an appropriate page-capture option, such as fullPage: true, rather than spending effort locating a node inside the shadow tree.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return a screenshot or PDF; the service accepts the URL and can return PNG, JPEG, or WebP. See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

With ScreenshotNeo, cookie banners are accepted like a visitor and removed along with supported consent platforms, newsletter popups, and chat widgets before the shot; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. An MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up free for 1,000 screenshots a month—no card required.

Frequently Asked Questions

Can Puppeteer take a screenshot of a page that contains Shadow DOM?

Yes. For the whole rendered page, use page.screenshot(); for a specific element inside an open shadow root, select it and call ElementHandle.screenshot().

What is the difference between Puppeteer’s >>> and >>>> selectors?

Use >>> to search at any depth through open shadow roots below a host, and >>>> when the target is in the host’s immediate shadow root.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.