Direct answer: Puppeteer can capture a page that renders Shadow DOM normally, but selecting or changing an element inside that DOM requires Puppeteer’s deep combinators. Use >>> to search through open shadow roots at any depth, or >>>> for the immediate shadow root. Put the page into the state you need, then call page.screenshot(). Closed shadow roots remain an access boundary: their rendered pixels can appear in a screenshot, but their internal nodes are not available through normal JavaScript queries.
How do I take a screenshot of a page containing Shadow DOM?
A screenshot is a capture of the rendered page, not a dump of the document tree. If a custom element paints content from an open or closed shadow root, Chromium renders that content and Puppeteer’s screenshot API captures it as part of the page. You do not need a special screenshot flag merely because Shadow DOM is present.
The important distinction is capture versus selection. Use page.screenshot() for the image. Use a deep selector, a locator, or page-context JavaScript only when you must click, read, hide, or otherwise change something inside a component before capturing.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({
path: 'page.png',
fullPage: true
});
await browser.close();
fullPage: true extends the capture to the document’s full scroll height. Omit it for the current viewport. Use clip for a page-region capture, path to write a file, and omitBackground: true when you need transparency. The output format is inferred from the filename extension; PNG does not use the quality option.
Recommended Free Tools
#1 Best Overall
- 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
- 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
- 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
- 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
- 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0
How can I select an element inside a shadow root with Puppeteer?
Use the deep descendant combinator
Ordinary CSS selectors stop at a shadow boundary. Puppeteer adds >>> so a selector can descend through open roots:
const button = page.locator('my-widget >>> button');
await button.click();
This matches a button at any depth below my-widget, provided every shadow root on the path is open. It is useful when a component contains nested components and you do not want to encode each intermediate host.
Limit the search to the immediate shadow root
await page.locator('my-widget >>>> button').click();
>>>> is the deep child combinator. It searches only the host’s immediate shadow root, rather than descendants at arbitrary depth. Choose it when you want to avoid accidentally matching a similarly named control in a nested component.
Complete interaction-then-capture example
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com/dashboard', { waitUntil: 'networkidle2' });
// The locator waits for the target to exist and be actionable.
await page.locator('settings-panel >>> theme-picker >>> button[data-theme="dark"]').click();
await page.screenshot({ path: 'dark-dashboard.webp', fullPage: true });
await browser.close();
Replace the hosts and target selector with the component’s actual markup. Interact first, wait for the resulting state, and only then capture. If the component updates asynchronously, wait for a visible state marker rather than relying on an arbitrary delay.
Waiting for Shadow DOM content before capture
Custom elements can be present before their internal content is rendered. A reliable workflow waits for a host and then for the deep target or a state change.
Rank #2
- [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
- [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
- [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
- [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
- [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.
await page.locator('my-widget').wait();
await page.locator('my-widget >>> [data-ready="true"]').wait();
await page.screenshot({ path: 'ready.png', fullPage: true });
For a component whose only stable signal is text or a property, use page-context evaluation after the host exists:
await page.waitForFunction(() => {
const host = document.querySelector('my-widget');
return host?.shadowRoot?.querySelector('[data-ready="true"]');
});
Use a bounded timeout in production so a broken component does not hold a job forever. A locator action is generally preferable for clicks because Puppeteer waits for presence and an appropriate action state. Lower-level methods such as $eval require you to handle timing and missing matches yourself.
Reading or modifying a node with $eval
page.$eval(selector, pageFunction) passes the matched element into a function running in the page context. Puppeteer’s selector support allows the same shadow-aware syntax, subject to open-root limits.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →const label = await page.$eval(
'profile-card >>> [data-user-name]',
element => element.textContent?.trim()
);
console.log(label);
await page.$eval(
'profile-card >>> .private-note',
element => { element.style.display = 'none'; }
);
await page.screenshot({ path: 'without-note.png' });
Do not use this technique to depend on private implementation details when a component exposes a public API. Component internals can change without changing the host element’s contract.
Open versus closed shadow roots
Open roots
An open root is created with attachShadow({ mode: 'open' }). Its shadowRoot is exposed, so Puppeteer’s documented deep combinators can traverse it. Every root in a multi-level path must be open for a deep selector to reach the final node.
Rank #3
- 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
- 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
- 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
- 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
- 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.
Closed roots
A closed root is created with mode: 'closed'. The host’s shadowRoot property is null, and the internals are intentionally hidden from outside JavaScript. A deep selector that targets a node inside that root can therefore return no match even though the component is visibly rendered.
You can still capture the page or a region containing the component:
await page.screenshot({
path: 'closed-component.png',
clip: { x: 120, y: 80, width: 900, height: 500 }
});
If you own the component and automation access is a requirement, expose a supported public method or use an open root. Otherwise, test the component through its public controls and assert on the rendered result rather than reaching into hidden nodes.
Choosing screenshot coverage and output
| Requirement | Puppeteer setting | Result |
|---|---|---|
| Current viewport | No special option | Captures what is visible in the viewport |
| Entire document | fullPage: true |
Captures the full scrollable page |
| Specific region | clip: { x, y, width, height } |
Captures a rectangular page area |
| Transparent background | omitBackground: true |
Leaves the page background transparent where Chromium permits it |
| File output | path: 'name.png' |
Writes the image; extension selects the format |
| In-memory output | Omit path |
Returns a Uint8Array; base64 configuration returns a string |
Set the viewport before navigation when responsive breakpoints affect the component. For pixel comparisons, keep viewport dimensions, device scale factor, fonts, locale, timezone, and animations consistent between runs. If a shadow component lazy-loads images, wait for its loaded state before taking a full-page image.
Why a deep selector returns no match
- Wrong host selector: Inspect the light-DOM custom-element name and attributes. The deep combinator cannot compensate for a host that is not present.
- Content has not rendered: Wait for the host and a stable descendant or state marker. Navigation completion alone does not guarantee that a web component has finished updating.
- A root is closed: Puppeteer cannot traverse that boundary. Capture the rendered page, use the component’s public API, or ask the component owner for an automation hook.
- Incorrect depth operator: Replace
>>>>with>>>when the target is nested below another shadow host. - Unsupported selector composition: Deep combinators operate at the first depth of CSS selectors. Do not assume they work when embedded inside complex constructs such as
:is(...); split the query into simpler steps. - Action is blocked: An overlay, disabled control, or off-screen element can prevent a click. Wait for the correct state, remove an intentional overlay, or use a supported component method.
Reliable screenshot patterns for CI and services
Use explicit navigation and time limits
await page.goto(targetUrl, {
waitUntil: 'networkidle2',
timeout: 60000
});
await page.setDefaultTimeout(15000);
Choose the navigation event that matches the site. Network idle can be unsuitable for pages with long-lived analytics or streaming requests; in that case, wait for a component-specific readiness marker instead.
Rank #4
- 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
- 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
- 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
- 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
- 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
Freeze transient visuals
Disable animations and caret blinking with an injected style when visual diffs must be stable:
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 glitchesawait page.addStyleTag({ content: `
*, *::before, *::after {
animation: none !important;
transition: none !important;
caret-color: transparent !important;
}
` });
Apply this before the final state is rendered, and avoid hiding content that the screenshot is meant to test.
Close resources in every path
Wrap the browser lifecycle in try/finally in a worker so failures do not leak Chromium processes. Reuse a browser carefully for throughput, but create isolated pages and clear cookies or storage when tests must not share state.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server. It accepts a URL and returns PNG, JPEG, WebP, or PDF. Its capture pipeline accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.
For a one-off capture, use the documented GET endpoint:
Free tools Windows power users keep installed
One-click scans. No signup required.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo documentation for request options. The service supports full-page and element captures, dark mode, device presets or custom viewports, retina scale, PDF paper settings and page ranges, custom CSS and JavaScript, clicks, selector waits, delays, network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, OpenAPI, and compatibility with parameter names used by other screenshot APIs. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
Best Value
- AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
- Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
- Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
- Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
- Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions
| Plan | Included shots | Price |
|---|---|---|
| Free | 1,000 per month | $0, no card |
| Starter | 3,000 | $5 |
| Growth | 15,000 | $15 |
| Pro | 60,000 | $39 |
| Scale | 250,000 | $99 |
| Business | 1,000,000 | $249 |
Yearly billing provides two months free, and every feature is available on every plan. Create a free ScreenshotNeo account to get 1,000 screenshots each month without adding a card.
Practical decision guide
- Use Puppeteer when you need browser-level assertions, application-specific interactions, or access to an open component you control.
- Use a whole-page screenshot when the component’s internals are closed or irrelevant to the test; the browser still captures its rendered appearance.
- Use ScreenshotNeo when you want an HTTP call, automated consent and popup cleanup, billing protection for failed captures, or an MCP workflow for AI agents.
Frequently Asked Questions
Does Shadow DOM content appear in Puppeteer screenshots automatically?
Yes. Screenshot capture records the rendered page, so visible content from open or closed roots is included. Shadow-aware selectors are needed only when you must inspect or change an internal element first.
What is the difference between Puppeteer’s >>> and >>>>?
>>> searches through open shadow roots at any depth. >>>> limits the search to the host’s immediate shadow root.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Can Puppeteer access a closed shadow root?
Not through the host’s shadowRoot property or documented deep combinators. You can capture its rendered pixels, but internal automation requires a public component interface or an open root.
What does Puppeteer return when no screenshot path is supplied?
The screenshot API returns image bytes as a Uint8Array by default; with base64 encoding configured, its documented overload returns a string.
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.

