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 capture embedded content with Puppeteer, wait for the iframe’s content to be ready, then take a screenshot of the page with await page.screenshot({ path: 'page.png' }). Use Puppeteer’s frame tree when you need to inspect or interact with the iframe’s DOM; you do not need to switch frames just to capture the rendered page.
Capture the whole page, including its iframe
Puppeteer’s screenshot guide documents page-level screenshots, and its API reference defines Page.screenshot() as capturing a screenshot of the page. For a straightforward capture:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com/page-with-iframe', {
waitUntil: 'networkidle2',
});
await page.screenshot({ path: 'page-with-iframe.png' });
} finally {
await browser.close();
}
})();
Replace the example URL with the page you need to capture. The screenshot guide uses networkidle2 as a navigation wait example, but network activity settling does not guarantee that every embed has finished rendering. For an asynchronous iframe, wait for its frame and a target-specific readiness signal before taking the screenshot.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Wait for the iframe and meaningful content
Puppeteer represents iframes as frames in a page’s frame tree. A Frame corresponds to a DOM frame such as an iframe; the page provides mainFrame(), and frames expose child frames. This lets you locate the frame and wait for content without changing the screenshot boundary: the final page screenshot still captures the rendered page.
#1 Best Overall
- 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 puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com/page-with-iframe', {
waitUntil: 'networkidle2',
});
const iframeHandle = await page.waitForSelector('iframe');
const frame = await iframeHandle.contentFrame();
if (!frame) throw new Error('iframe did not produce a frame');
// Replace this with a selector that signals usable content on your site.
await frame.waitForSelector('body');
await page.screenshot({ path: 'page-with-iframe.png' });
} finally {
await browser.close();
}
})();
A body element only shows that the frame has a document body; it may not mean the embedded application has finished loading or displaying the content you need. Prefer a stable selector or application-ready signal from the embed. The right signal depends on the page, and Puppeteer’s frame API does not prescribe one universal readiness condition.
Choose the screenshot boundary
Capture the whole page
Use page.screenshot() when the result should show the surrounding page as well as the visible iframe. This is the usual choice for a screenshot of a page containing embedded content.
Rank #2
- 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
Capture only the iframe region
If you only need the iframe’s visible area, screenshot its element handle after confirming it exists and is visible. The Puppeteer guide documents ElementHandle.screenshot(); it attempts to scroll a hidden element into view.
const iframeHandle = await page.waitForSelector('iframe');
await iframeHandle.screenshot({ path: 'iframe-region.png' });
Choose the element screenshot when the iframe rectangle is the intended output. Choose a page screenshot when context around the embed matters.
Rank #3
- 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.
Inspect or interact with iframe content
Use frame access when you need to query selectors, read text, or perform actions inside the embedded document before capture. For example, once you have a frame as shown above, you can wait for a specific element with await frame.waitForSelector('.ready') or inspect it with await frame.$eval('.title', element => element.textContent). Replace those selectors with ones that actually exist in the target embed.
DOM access and visual capture are separate operations: locating a frame helps you work with its content, while page.screenshot() captures the rendered page. The official documentation reviewed does not establish a universal workaround for every cross-origin embed, browser build, authentication state, or site policy. Test the target page in the browser and environment you intend to use.
Rank #4
- 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
Troubleshoot missing or incomplete embedded content
- The iframe is absent: The page may add it after initial navigation. Wait for the iframe selector with
page.waitForSelector('iframe')before asking for its content frame. contentFrame()returns null: The handle has not produced a frame at that point. Confirm the selector identifies an iframe and retry after the embed appears.- The screenshot shows a blank or partial embed: Navigation completion is not proof that the embedded app is visually ready. Wait for a meaningful selector or application-specific ready signal inside the frame before capturing.
- The iframe-only screenshot is not the intended region: Confirm the iframe handle is the element you mean to capture and that it is visible. Use
page.screenshot()instead if the output needs the surrounding page. - Frame inspection or rendering differs across environments: The cited documentation does not establish identical behavior for every cross-origin embed, authentication state, browser build, or site policy. Validate the actual target and setup rather than assuming a general bypass.
Or skip the browser setup
If you need a screenshot through an API instead of managing Puppeteer, ScreenshotNeo takes a URL in one GET request. Its API can return PNG, JPEG, WebP, or PDF; cookie and consent banners, newsletter popups, and chat widgets can be removed before capture, with each cleanup step independently switchable. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. An MCP server provides screenshot tools for Claude, Cursor, and other MCP clients.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/page-with-iframe -o shot.webp
See the ScreenshotNeo API documentation for request options. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Sign up for free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Which Puppeteer version do these examples target?
The cited Puppeteer screenshot and Frame documentation identify version 25.12.0 at the time they were consulted; check the current API documentation for changes before using a different version.
Quick Recap
Best Value
- 【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.
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.

