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

Use Puppeteer’s request interception to abort requests that match rules you choose, then capture the page with page.screenshot(). The key is to resolve every intercepted request—by continuing, aborting, or responding—or it can stall. Puppeteer provides request URLs and resource types, but it does not supply an authoritative built-in ad-and-tracker classifier.

Install Puppeteer and save a screenshot

The example below uses ES modules. Install Puppeteer in a project, save the code as screenshot.mjs, and run it with Node.js. Puppeteer’s official documentation identifies version 25.12.0; check the documentation for the version you install because the pages and API may change.

npm install puppeteer
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

Page.screenshot() saves a viewport screenshot by default as PNG. Set fullPage: true to capture the full document, as above. If you need only a region, use the clip screenshot option; for a particular element, use ElementHandle.screenshot(). It attempts to scroll an off-screen element into view before capture. See the Puppeteer screenshot guide and ScreenshotOptions API.

Block requests with explicit rules

Enable interception before navigation, then resolve every request. This runnable example blocks one illustrative URL substring and allows all other requests through:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.setRequestInterception(true);

  page.on('request', request => {
    if (request.url().includes('/known-tracker-endpoint/')) {
      return request.abort();
    }
    return request.continue();
  });

  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

The substring is a demonstration, not a verified tracker signature or maintained blocklist. Replace it with patterns appropriate to the site and validate the result. Puppeteer’s interception example likewise demonstrates mechanics with narrow file-extension rules, not comprehensive ad detection. See Puppeteer network interception and Page.setRequestInterception().

Choose rules carefully

You can inspect request.url() and request.resourceType() to build a policy. Resource type is not a semantic label: a script, image, or stylesheet may be essential page content. Blocking an entire type can change the page and therefore the screenshot. URL/domain rules or a curated set of rules give you more control, but no rule set is guaranteed to identify every ad or tracker.

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

Handle multiple request listeners

If other code or libraries also add interception handlers, a request might already have been resolved. Check request.isInterceptResolutionHandled() before acting to avoid resolving it twice. Puppeteer’s cooperative interception mode coordinates handlers that all provide numeric priorities; without a priority, resolution is immediate under legacy behavior. A simple pass-through handler should explicitly call continue(). The interception guide describes the handling and priority behavior.

Choose capture scope and readiness

Viewport, full page, or clipped region

  • fullPage: false captures the current viewport; this is the documented default.
  • fullPage: true captures the full document.
  • clip captures a defined region.

Screenshot options also include output type, omitBackground, path, and quality. PNG is the documented default; quality applies to formats that support it, not PNG. Consult the ScreenshotOptions API for the current option details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Wait for the page you actually need

waitUntil: 'networkidle2' is a navigation wait option, not a guarantee that a site’s visual content is settled. Dynamic pages may render important content after navigation completes. For those pages, wait for a meaningful selector or an application-specific ready state before taking the screenshot. There is no universal readiness condition that fits every site.

Troubleshoot common failures

  • Navigation or screenshot appears stuck: An intercepted request may not have been continued, aborted, or answered. Ensure every handler resolves the request, including the pass-through branch.
  • A request-resolution error occurs: Another listener may already have handled the request. Use request.isInterceptResolutionHandled() before attempting another resolution, and review any installed interception handlers.
  • The screenshot is missing page content: A broad resource-type rule may have blocked a required script, stylesheet, or image. Narrow the policy and inspect the affected request URLs and types.
  • The screenshot shows an incomplete dynamic page: Navigation idleness may have occurred before the relevant content appeared. Wait for a page-specific selector or ready state before capture.
  • Authentication changes request behavior: Puppeteer’s page.authenticate() enables interception internally and may affect performance. Account for that when designing request handling; see the Page.authenticate() API.

Or skip the browser setup

ScreenshotNeo takes a screenshot or PDF with one GET request. See the ScreenshotNeo API documentation.

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
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; these cleanup steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server offers screenshot tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo for the service details, or sign up free for 1,000 screenshots a month with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does Puppeteer have a built-in ad blocker?

No. It exposes request information and interception controls; you define the rules that decide what to block.

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.

Can I capture just one page element?

Yes. Use ElementHandle.screenshot() on the element handle.

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.

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.