October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Screenshot a Website Through a Proxy With Puppeteer

Configure proxy routing when launching Puppeteer, navigate to the page, and use screenshot options that match the content you need to capture.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To screenshot a website through a proxy with Puppeteer, configure the proxy on the browser when launching it, navigate to the target page, then capture it with page.screenshot(). Puppeteer exposes browser command-line arguments through launch({ args }); the proxy endpoint and any authentication settings must match your proxy provider and browser setup. The official Puppeteer documentation cited below explains the launch extension point and screenshot methods, but does not provide a verified proxy-flag or universal proxy-authentication recipe.

Set up the page capture

Install Puppeteer in a Node.js project, then use its browser launch options to pass any browser-specific proxy configuration. This example deliberately leaves the proxy argument out: Puppeteer’s documented args option is the place to pass additional browser command-line arguments, but the cited Puppeteer API does not specify the exact proxy flag or authenticate a proxy for you. Confirm the correct syntax and authentication method for your browser, proxy protocol, and provider before adding it.

As an Amazon Associate I earn from qualifying purchases.

npm install puppeteer
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    // Add browser-specific proxy configuration to args after verifying
    // the syntax for your browser and proxy provider.
    args: []
  });

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

The try/finally ensures the browser is closed even if navigation or capture fails. Replace https://example.com with the page you want to capture. Add the verified proxy setting to the launch configuration before creating or navigating pages so the browser uses that configuration for the session. Puppeteer’s launch API documents args as additional command-line arguments passed to the browser instance: LaunchOptions.

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

Choose the screenshot scope and output

Full page

Use fullPage: true to capture the rendered document beyond the initially visible viewport, as in the example. Pages that load content only after scrolling may require additional handling before capture; a full-page option alone does not guarantee every lazy-loaded asset has appeared.

#1 Best Overall
WatchGuard Firebox M295 High Availability Unit with 3 Year Standard Support - HA Device for Failover, Requires Matching Primary - Not a Standalone Device - Rackmount Firewall (WGM295000+WGM2951603)
  • High Availability (HA) redundant unit for resilient failover and uptime. Operates only as the secondary in an HA pair and must be paired with a primary WatchGuard Firebox of the same model for synchronization and failover. Not a standalone appliance.
  • WatchGuard Firebox M295 High Availability Unit with 3 Year Standard Support License (WGM29501603) - The Firebox M295 combines enterprise-grade security with multi-gig connectivity, SD-WAN, TLS decryption, and proxy-based inspection in a compact rackmount design.
  • Standard Support covers software updates and round-the-clock emergency help. Add a Basic or Total Security Suite to activate IPS, gateway antivirus, and web filtering so threats are blocked before they reach users.
  • Standard Support provides reliable technical assistance and software updates for WatchGuard Firebox appliances. Offering 24x7 help for emergencies and business-hours support for routine needs, it ensures your network stays secure and operational.
  • Interfaces and continuity: 4x 2.5Gb RJ45, 4x 1Gb RJ45, 2x 10Gb SFP+ with VLANs and link aggregation, plus RIP, OSPF, BGP, and high availability to keep sites online.

A specific element

For a component rather than the whole document, locate it and call ElementHandle.screenshot(). Puppeteer scrolls the element into view if needed.

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

A rectangular region

Pass a clip rectangle to page.screenshot() when you need a defined area of the page. The clip rectangle uses page coordinates and dimensions.

await page.screenshot({
  path: 'region.png',
  clip: { x: 20, y: 100, width: 800, height: 500 }
});

Format and quality

Set path to choose the output file and extension, and use the documented screenshot options for the image type and related controls. Quality applies to supported lossy image formats; it does not change PNG output. Puppeteer’s screenshot guide covers full-page, clipped, and element captures: Screenshots. Its API reference lists ScreenshotOptions: ScreenshotOptions.

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

Understand proxy configuration and authentication

The proxy is a browser-session concern, while page.screenshot() is the capture step. Configure routing at launch using the argument format supported by the selected browser and proxy. The Puppeteer sources cited here do not establish one proxy flag that works across all browsers, protocols, providers, or versions, so do not copy an unverified example into production.

Do not put proxy credentials directly in source code committed to version control. Use your deployment’s secret-management approach and check the provider’s instructions for credential placement and supported authentication. Puppeteer documents page.authenticate() for HTTP authentication, but that documentation alone does not confirm behavior for every proxy protocol or provider: Page.authenticate().

Likewise, the @puppeteer/browsers package documents respecting HTTP_PROXY, HTTPS_PROXY, and NO_PROXY when proxy-agent is installed for that package’s library and CLI. That behavior should not be assumed to route ordinary web-page traffic from a Puppeteer-launched browser: @puppeteer/browsers API.

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

Wait for a useful page state

The sample waits for networkidle2 before capture, which can suit pages that settle quickly. Some sites keep network requests open or load important content later, so a network-idle wait may be unsuitable. Choose a navigation wait condition that matches the page, or wait for a specific selector or known delay before taking the screenshot. If content is missing, inspect the page state and browser logs before increasing timeouts indiscriminately.

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

Troubleshoot common failures

  • The browser launches but the target cannot be reached: verify the proxy endpoint, protocol, credentials, network access, and the browser-specific argument syntax. Puppeteer’s cited launch API does not validate those provider details for you.
  • The target loads directly instead of through the proxy: confirm that the proxy configuration was applied to the browser launch. Do not rely on HTTP_PROXY or HTTPS_PROXY alone for page traffic based on documentation scoped to the browser-management package and CLI.
  • Navigation times out: check whether the proxy is reachable and whether the page keeps connections open. Try a wait condition appropriate to the page, and distinguish a page that rendered useful content from one that never loaded.
  • The screenshot is blank or incomplete: wait for the actual content selector, check for delayed or scroll-triggered assets, and verify that the page finished rendering before capture.
  • Element capture fails: confirm that the selector matched an element. The sample throws an explicit error when .product-card is absent.
  • PNG looks unchanged after setting quality: quality controls do not apply to PNG; choose a supported lossy format if quality adjustment is required.

Or skip the browser setup

If you need an API rather than managing a Puppeteer browser and proxy configuration, ScreenshotNeo returns a screenshot or PDF from one GET request. Cookie and consent banners, newsletter popups, and chat widgets can be removed before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. An MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients.

For available request options, see the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo and start with 1,000 free screenshots a month, no card required.

Frequently Asked Questions

Which Puppeteer documentation version is referenced here?

The documentation search results cited for this article displayed Puppeteer version 25.12.0; check the linked pages for the current API.

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.

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
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.