DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Make a Website Thumbnail from a URL with Puppeteer

A practical Puppeteer guide to making URL-based website thumbnails, with viewport and full-page options, readiness waits, status checks, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Puppeteer to open the URL in a Chromium page, set the viewport to the thumbnail dimensions, wait for the page to become ready, then save page.screenshot(). A normal screenshot captures the visible viewport; use fullPage: true only when you specifically want a long image of the whole page.

Make a thumbnail with Puppeteer

Install Puppeteer in a Node.js project, then run this script with a URL that includes its scheme, such as https://example.com. The viewport is set before navigation so responsive pages can render at the intended size.

As an Amazon Associate I earn from qualifying purchases.

  1. Install Puppeteer: npm install puppeteer.

  2. Save the following as thumbnail.mjs.

  3. Run it with node thumbnail.mjs https://example.com. Puppeteer writes thumbnail.png in the current directory.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import puppeteer from 'puppeteer';

const url = process.argv[2];
if (!url) throw new Error('Pass a URL as the first argument');

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.setViewport({ width: 1280, height: 720, deviceScaleFactor: 1 });

  const response = await page.goto(url, {
    waitUntil: 'networkidle2',
    timeout: 30_000,
  });

  if (response && !response.ok()) {
    throw new Error(`Page returned HTTP ${response.status()}`);
  }

  await page.screenshot({ path: 'thumbnail.png', type: 'png' });
} finally {
  await browser.close();
}

The navigation wait uses networkidle2, an example in the Puppeteer screenshot guide, not a universal signal that every site has finished rendering. Sites with ongoing network traffic or delayed client-side rendering may need a page-specific readiness condition. Always close the browser in finally so an error does not leave the browser process running.

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black | 1080p with auto-light correction, built-in mic, privacy shutter, USB-A, compatible with Teams, Google Meet, Zoom and more
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

Choose the kind of thumbnail

Viewport thumbnail

The example captures the 1280-by-720 viewport, a useful landscape preview shape. Set the width and height to match the space where the thumbnail will appear. The device scale factor controls pixel density: a value of 1 produces an image at the viewport dimensions, while a higher value produces more pixels. Set the viewport before navigation because responsive websites use it to choose their layout; changing it later can reload some pages. See Puppeteer’s viewport documentation.

Full-page image

For an image of the entire scrollable page, use fullPage: true:

await page.screenshot({ path: 'full-page.png', fullPage: true });

A full-page capture can be very tall, which usually makes it less suitable for a compact preview. Puppeteer documents fullPage and other screenshot settings in the screenshot options reference.

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.

Capture one element

If the thumbnail should show a particular card, hero, or other element rather than the viewport, locate it and capture its bounding element:

const element = await page.$('.hero-card');
if (!element) throw new Error('Could not find .hero-card');
await element.screenshot({ path: 'hero-card.png' });

Replace .hero-card with a selector present on the target page. Puppeteer’s screenshot guide covers ElementHandle.screenshot() alongside page screenshots.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black | Auto-Light Correct, Noise-Reducing Mic, Zoom, Microsoft, Teams, Skype, Nintendo Switch 2 New GameChat Mode, PC Mac compatible
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Format and output options

Page.screenshot() supports a file path, image type, quality, clipping region, full-page capture, and transparent background. The file extension can determine the format if a path is supplied; choosing type explicitly makes the intent clear. Quality applies to lossy image formats, not PNG. Consult the API reference for the supported options and combinations.

Wait for the page state you need

page.goto() returning means the selected navigation condition was met, not necessarily that a particular image, app widget, or delayed render is ready. networkidle2 can be unsuitable for sites that keep requests open or load content after navigation. When you know what the thumbnail depends on, wait for that specific element or readiness signal before capturing:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30_000 });
await page.waitForSelector('.thumbnail-content', { timeout: 10_000 });
await page.screenshot({ path: 'thumbnail.png' });

Use a selector that actually indicates the desired content is ready. A fixed delay is another option for a site whose rendering behavior you understand, but it can waste time or still be too short if the site is variable. Lazy-loaded content may require an explicit page-specific step to load it; there is no universal lazy-load recipe here.

Check HTTP status and navigation failures

Inspect the response when you need to distinguish a successful page from an HTTP error. Puppeteer’s page.goto() returns the main-resource response, or null for special cases such as about:blank. In headless shell mode, HTTP statuses such as 404 and 500 do not necessarily make navigation throw, so check response.status() or response.ok() yourself. See the Page.goto() API reference.

Troubleshooting

  • “Pass a URL as the first argument”: include a URL after the script name, for example node thumbnail.mjs https://example.com.

  • Navigation times out: the site may be slow or keep network activity open. Try a more appropriate navigation condition, then wait for a specific selector or readiness signal with a separate bounded timeout.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    Rank #4
    Sale
    EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera | USB Type-A & A-to-C Adapter, Fixed Focus, Plug&Play for Zoom/Teams/Facetime/YouTube/Google Meet/Switch 2 Camera, 2025 Version
    • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
    • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
    • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
    • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
    • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
  • The image is blank or incomplete: navigation may have finished before the relevant client-side content appeared. Wait for a page-specific element and confirm that it is visible before capture.

  • The script does not report a navigation error, but the page is an error page: inspect the returned response status; valid HTTP error responses do not always reject navigation.

  • The layout is wrong for the thumbnail: set the intended width and height before goto(), and verify the chosen dimensions against the page’s responsive breakpoints.

  • The screenshot is unexpectedly tall: remove fullPage: true unless a full-document capture is required.

    Free tools Windows power users keep installed

    One-click scans. No signup required.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Browser processes remain after a failed capture: ensure the capture is enclosed in try/finally and call browser.close() from the finally block.

    Best Value
    Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black | 30fps Video, Clear Audio, Light Correction, Works with Teams, Meet, Zoom, Nintendo Switch 2, Mac, Tablet
    • Compatible with Nintendo Switch 2’s new GameChat mode
    • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
    • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
    • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
    • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and safe URL handling

Each capture launches or uses a browser, navigates to a remote site, and waits for the selected readiness condition. A narrower, page-specific wait can avoid waiting for unrelated network activity, but should still allow enough time for the content your thumbnail needs. Bound navigation and selector waits so a slow or unusual page cannot hold a job indefinitely.

If you turn this script into a service that accepts arbitrary user URLs, browser navigation can contact destinations beyond the requested document. Treat URL validation, network egress restrictions, resource and time limits, and browser isolation as production security requirements. The Puppeteer API references cited above document capture and navigation behavior, not a complete defense against server-side request forgery; design those controls separately.

Or skip the browser setup

ScreenshotNeo provides a screenshot API that returns an image or PDF from one GET request. Example using cURL:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 documentation for API details. It accepts cookie and consent banners as a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. ScreenshotNeo also has an MCP server with screenshot, page-info, and PDF-capture tools for AI agents. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Sign up free for 1,000 screenshots a month, no card required.

Frequently Asked Questions

Does Puppeteer capture the whole page by default?

No. A standard page screenshot captures the viewport; set fullPage: true for the scrollable page.

Can I capture a page element instead of the viewport?

Yes. Find the element and call ElementHandle.screenshot() to save its image.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.