Chromium screenshot kaise lein: full webpage capture guide
Capture a full webpage in Chromium with DevTools, automate viewport screenshots with Headless Chrome, and choose PDF when you need a document.
To save an entire webpage as an image in Chromium, use Chrome DevTools’ full-page screenshot workflow. For repeatable automation, use Headless Chrome with Puppeteer or the DevTools Protocol; the basic --screenshot command captures a viewport whose size you choose, not automatically the entire page height. If you need a document rather than an image, use --print-to-pdf.
Choose the right capture method
Start by deciding what extent and output you need:
| Need | Method | What it produces |
|---|---|---|
| Whole page, captured manually | Chrome DevTools full-page screenshot | An image of the page beyond the visible viewport |
| Visible browser viewport, repeatably | Headless Chrome --screenshot |
A PNG at the configured window size |
| Automated browser workflow or custom capture logic | Puppeteer or DevTools Protocol | Programmatically controlled screenshot capture |
| Printable document | Headless Chrome --print-to-pdf |
A PDF, not a full-page PNG |
| One visible region | DevTools area screenshot | An image of a manually selected rectangle |
DevTools also supports screenshots of selected DOM nodes, nodes larger than the screen, mobile versions, and selected areas. Area capture and full-page capture are different workflows. [Chrome DevTools screenshot guide]
Capture a full webpage manually with DevTools
- Open the page you want to save in Chromium.
- Open Chrome DevTools and use its full-page screenshot capture workflow. The exact menu sequence can vary by Chrome version; consult the current DevTools screenshot guide for the available capture techniques.
- Save the resulting image and inspect its top, middle, and bottom to confirm the page content you need is present.
The official guide confirms full-page capture as a supported DevTools technique, but does not specify the exact current menu sequence in its text. Avoid confusing it with Capture area screenshot: that command captures a dragged rectangle, and Chrome documents that area capture does not work while DevTools is undocked. [Screenshot techniques] [Command Menu documentation]
Capture a viewport screenshot with Headless Chrome
For a repeatable command-line capture, run Chromium in headless mode and set the window dimensions explicitly:
chrome --headless --screenshot --window-size=1280,1696 https://example.com/
Headless Chrome writes screenshot.png to the current working directory. The example dimensions are a chosen viewport, not a universal standard. The basic documented --screenshot flag does not set the viewport height to the full document height, so a tall page may be clipped. [Chrome Headless command-line reference]
To choose a useful viewport, consider the page layout you want to review and the width at which the page should render. A narrow viewport can trigger a mobile layout; a wide viewport can show desktop navigation. The configured height controls the viewport, not a promise to capture every vertically distant element.
Wait for delayed content
Pages may add content after navigation through JavaScript, timers, or network requests. A screenshot taken too early can miss it. Headless Chrome offers bounded waiting options:
chrome --headless --timeout=5000 --screenshot --window-size=1280,1696 https://example.com/
--timeout is a maximum wait in milliseconds before screenshot, DOM dump, or PDF capture occurs, even if the page is still loading. For pages driven by time-dependent JavaScript such as setTimeout or setInterval, use a virtual-time budget:
chrome --headless --virtual-time-budget=5000 --screenshot --window-size=1280,1696 https://example.com/
These flags control capture timing; they do not guarantee that every lazy-loaded image or section has been triggered. Some pages only load content when it approaches the viewport, so inspect the output and use browser automation that scrolls through the page when that behavior matters. [Headless CLI options]
Automate capture with Puppeteer
Puppeteer is a Node.js library for controlling Chrome. It can navigate to a page, wait for a condition, and save a screenshot. This example captures the configured viewport; it does not claim to reproduce DevTools’ full-page screenshot workflow in every page condition.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 1696 });
await page.goto('https://example.com/', { waitUntil: 'networkidle2', timeout: 30000 });
await page.screenshot({ path: 'screenshot.png' });
} finally {
await browser.close();
}
For a full-page image through Puppeteer, set fullPage: true in the screenshot options:
await page.screenshot({ path: 'full-page.png', fullPage: true });
Use a wait condition appropriate to the site. A network-idle condition may not occur on pages with persistent requests, while waiting only for navigation can be too early for content rendered afterward. For difficult pages, wait for a known selector or use a bounded delay, then check the saved image. Puppeteer can drive headless or full Chrome and supports screenshots, PDFs, navigation, and page information. [Headless Chrome overview]
Save a page as PDF instead
If the result should be a printable document, use Chrome’s PDF output rather than treating a very tall screenshot as a document:
chrome --headless --print-to-pdf=output.pdf --no-pdf-header-footer https://example.com/
--print-to-pdf creates output.pdf; --no-pdf-header-footer removes the print header and footer. A PDF paginates content for a document workflow, while a full-page screenshot is an image. [Headless CLI PDF options]
Or skip the browser setup
ScreenshotNeo provides a screenshot API: one GET request returns an image or PDF. See the ScreenshotNeo API documentation for options and parameters.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo removes cookie banners, popups, and chat widgets before capture. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Every feature is on every plan. Learn more about ScreenshotNeo and sign up for 1,000 free screenshots a month, with no card.
Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| The output ends before the bottom of the page | The CLI screenshot captured the chosen viewport height. | Use DevTools full-page capture for a manual whole-page image, or Puppeteer’s fullPage: true. Check that your automation has scrolled or otherwise triggered lazy content when needed. |
| Text, images, or sections are missing | The capture happened before asynchronous content appeared, or lazy loading was not triggered. | Increase the bounded wait, use an appropriate virtual-time budget for timer-driven code, wait for a known element, or scroll the page before capturing. |
| Area capture is unavailable | DevTools is undocked. | Dock DevTools and retry the area screenshot workflow. This limitation applies to area capture, not the documented full-page technique. [Command Menu documentation] |
| Headless output is saved somewhere unexpected | --screenshot writes to the current working directory. |
Run the command from the desired directory, then look for screenshot.png. |
| The result is a PDF when an image was expected | --print-to-pdf creates a document, not a PNG. |
Use --screenshot or DevTools for image output. |
| The browser exits before a slow page finishes | The configured maximum wait is too short, or the page has not reached the needed content state. | Adjust --timeout or Puppeteer’s navigation timeout and wait for a specific page condition; remember that a timeout only bounds waiting and does not prove all content loaded. |
Performance, reliability, and cost
- Performance: Capturing a full long page requires more rendering and produces a larger image than a viewport capture. Choose the smallest viewport and output extent that answer your task; avoid repeatedly launching browsers if you are building a high-volume workflow.
- Reliability: Use explicit dimensions and bounded waits. A fixed delay is simple but can waste time on fast pages and still be too short on slow ones. Waiting for a page-specific selector is often a better signal when you control the target page.
- Dynamic pages: Animation, personalized content, consent prompts, and lazy loading can make captures differ between runs. Record the URL and capture conditions alongside important screenshots so a later reviewer can understand what was rendered.
- Cost: Local DevTools and a locally run Chromium command do not require a screenshot API subscription, though browser hosting and maintenance may have their own costs. ScreenshotNeo has a free 1,000-shot monthly plan with no card; paid options are Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000. Yearly billing gives two months free.
FAQ
Does Chromium’s --screenshot flag capture the entire page?
The documented basic flag saves a screenshot at the chosen window size; it is not documented as a full-page-height switch. Use DevTools’ full-page workflow or browser automation configured for full-page capture.
Is an area screenshot the same as a full-page screenshot?
No. An area screenshot captures a selected rectangle. Full-page capture covers the page beyond the visible viewport.
Should I use PNG or PDF?
Use an image when you need a screenshot asset. Use PDF when you need a paginated document for reading, printing, or sharing.
Can a timeout guarantee that all page content is ready?
No. A timeout limits how long the browser waits. It cannot ensure that every asynchronous or lazy-loaded element has appeared.


