Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Take Website Screenshots with Chromium Through a Proxy

A practical guide to Chromium website screenshots through a proxy, including Playwright setup, direct launch flags, readiness, repeatability, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright or Puppeteer to launch Chromium with a proxy, navigate to the page, wait for the content you need, and call the framework’s screenshot API. In Playwright, you can set the proxy for the browser or an isolated context; Chromium also accepts proxy command-line flags. The examples below show a Playwright approach and a direct Chromium launch option.

Use Playwright to route page traffic through a proxy

Playwright’s Chromium proxy configuration accepts a proxy server and, when required, credentials and hosts to bypass the proxy. A browser-level setting applies broadly; a context-level setting lets you isolate sessions that need different proxy configurations. Playwright documents HTTP(S) and SOCKSv5 proxy support. Confirm the requirements of your proxy provider, especially for authentication.

As an Amazon Associate I earn from qualifying purchases.

Install Playwright and its Chromium build

For a Node.js project, install Playwright and its managed browser build:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. npm install playwright
  2. npx playwright install chromium

If you must download browsers behind a firewall, that is a separate proxy setup from routing pages in Chromium. Playwright documents HTTPS_PROXY for browser installation and NODE_EXTRA_CA_CERTS when an intercepting proxy uses a custom CA that is not trusted by default. See Playwright browser installation.

Runnable Node.js example

Save as screenshot.js. Replace the proxy address, credentials, bypass list, and target URL with values appropriate for your environment:

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({
    headless: true,
    proxy: {
      server: 'http://proxy.example.com:8080',
      username: 'PROXY_USERNAME',
      password: 'PROXY_PASSWORD',
      bypass: 'localhost,127.0.0.1'
    }
  });

  try {
    const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded', timeout: 60000 });
    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

Run it with node screenshot.js. The proxy server value must match the provider’s address and protocol; http:// and socks5:// are common forms, but use the scheme your provider specifies. Do not commit real proxy credentials to source control.

Use a proxy for one isolated context

If one browser process needs sessions with different proxy settings, configure the proxy when creating each context rather than on browser launch:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
const context = await browser.newContext({
  proxy: {
    server: 'socks5://proxy.example.com:1080',
    username: 'PROXY_USERNAME',
    password: 'PROXY_PASSWORD'
  }
});
const page = await context.newPage();

Close the context when finished. Context-level configuration is useful for isolation, but verify that it is supported by the Playwright version and browser setup you use. The documented proxy options are described in Playwright’s HTTP proxy documentation.

Choose a readiness condition before capturing

A successful navigation is not always a finished page. Pick a condition that matches the content you want to capture:

  • domcontentloaded waits for the document to be parsed, but not necessarily for images, fonts, or client-side rendering.
  • load waits for the load event, which may be delayed by page resources.
  • networkidle can suit pages that settle after network requests, but persistent polling or analytics can prevent it from being a reliable signal.
  • For dynamic pages, wait for a meaningful selector or application-specific state, then capture. For example: await page.locator('[data-ready="true"]').waitFor().

Set a realistic navigation timeout for your environment. A timeout is not proof that the proxy is broken: the target may be slow, unreachable, blocked by its own access policy, or waiting on long-lived requests. Playwright’s navigation options are documented at page.goto().

Capture a full page or a specific element

Playwright’s page.screenshot() captures a page; set fullPage: true when the image should extend beyond the viewport. To capture a particular element, use its locator’s screenshot method:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.locator('main article').screenshot({ path: 'article.png' });

Check that the selector uniquely identifies the intended content and that the element is visible before capture. Lazy-loaded images may not appear unless the page has scrolled far enough or the site has loaded them by another means. Puppeteer also provides Page.screenshot() and ElementHandle.screenshot(); its guide demonstrates waiting for networkidle2 before taking a screenshot, but that is an example rather than a universal readiness rule. See Puppeteer screenshots.

Launch Chromium directly with proxy flags

When you are launching Chromium yourself rather than using a framework’s proxy option, Chromium supports --proxy-server. A single proxy URI applies to all URLs; per-scheme mappings can select different proxies. For example:

chromium --headless --proxy-server="http://proxy.example.com:8080" 
  --user-data-dir=/tmp/chromium-shot 
  --screenshot=page.png --window-size=1440,1000 
  https://example.com

The command-line screenshot captures the browser’s viewport; it does not provide the same convenient page-readiness controls or element capture as an automation framework. Chromium documents --proxy-server=<scheme>=<uri>[:<port>][;...] | <uri>[:<port>] | "direct://" and --no-proxy-server. Use --no-proxy-server to disable proxy use. See Chromium network settings.

Keep proxy settings for browser downloads separate

Environment variables used to fetch browser binaries are not the same thing as a browser proxy for website traffic. Playwright documents HTTPS_PROXY for browser downloads. Puppeteer documents HTTP_PROXY, HTTPS_PROXY, and NO_PROXY for download and run configuration, but says these settings are ignored by puppeteer-core. For Puppeteer browser downloads behind a firewall, follow its current configuration guidance: Puppeteer configuration.

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

Make captures repeatable

A screenshot can vary even when the URL and viewport are unchanged. Playwright notes that rendering may differ with the host operating system, browser version, settings, hardware, power source, and headless mode. For visual comparisons, keep those conditions consistent and record them with the capture.

Puppeteer documents headless: true for its new headless mode and headless: 'shell' for the old headless shell. Playwright documents a separate headless-shell build and an opt-in to the newer mode through the chromium channel. Choose deliberately and record your mode rather than mixing captures from different configurations. See Playwright’s Chromium headless documentation and Puppeteer headless modes.

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

Troubleshoot common failures

  • Navigation times out: Check whether the proxy is reachable and whether its protocol and port are correct. Also test whether the target loads slowly or keeps requests open. Increase the timeout only when a longer wait is appropriate; otherwise wait for a page-specific selector.
  • Proxy authentication fails: Confirm the username, password, and provider’s authentication requirements. Framework fields do not establish compatibility with every provider or authentication challenge.
  • TLS or certificate errors: If traffic passes through TLS inspection, the proxy may require a trusted certificate authority. Configure trust according to the proxy provider and your runtime; for Playwright browser installation behind a custom-CA proxy, consult its browser installation guidance.
  • The page loads directly instead of through the proxy: Verify that you configured the browser or context’s page-traffic proxy, not only download-related environment variables. Check bypass rules for the destination host.
  • The screenshot is blank or incomplete: Wait for the actual content, confirm the selector is present, and consider whether lazy images or client-side rendering need more time or a specific trigger.
  • Captures differ across runs: Stabilize Chromium version, headless mode, viewport, host environment, and readiness condition; those variables can affect rendering.

Or skip the browser setup

If you need a screenshot without managing Chromium and a proxy-enabled browser session, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF; for example, this cURL request saves a WebP screenshot:

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

See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before capture, and each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. Its MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

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.

Frequently Asked Questions

Does Chromium proxy configuration also proxy DNS lookups?

That depends on the proxy protocol and browser/network behavior; the cited proxy settings do not establish a universal DNS-routing guarantee. Check your proxy provider’s documentation for its DNS handling.

Can a proxy make a site accessible if it blocks automated browsers?

No. Routing through a proxy does not override a target site’s access policies or guarantee that its content will load.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.