October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Screenshot Multiple URLs That Use Single Sign-On

A practical Playwright workflow for reusing an authorized sign-in across multiple URLs, saving individual screenshots, and protecting authentication state.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use browser automation to sign in once, save the authenticated browser state, then restore it while visiting each URL and saving a separate screenshot. This works when the target pages accept the saved state; it does not bypass MFA, CAPTCHA, conditional-access rules, or other sign-in controls. The example below uses Playwright and keeps the sensitive state file out of source control.

How the workflow works

  1. Choose authorized destinations. Make a list of the URLs and use an account permitted to access each one. Different routes or domains may follow different access policies.
  2. Sign in once in a clean browser context. Complete the site’s approved sign-in flow, including any identity-provider steps required for the account.
  3. Wait for authentication to settle. Sign-in redirects can set cookies over multiple steps. Wait for the final URL or a page element that only appears when signed in before saving state.
  4. Save state securely. Store the browser state in a private file excluded from version control.
  5. Restore state and capture each URL. Navigate to each destination, wait for its intended state, and save a distinct image file.
  6. Review the results. Check that every image shows the expected signed-in page, not a login screen, loading state, access-denied page, or redirect.

Runnable Playwright example

Install Playwright for Node.js with npm install playwright. Save the following as capture.mjs. The first run signs in interactively and writes the state file; subsequent runs reuse it to capture the listed URLs. Replace the example URLs and the success selector with ones appropriate to your site.

As an Amazon Associate I earn from qualifying purchases.

import { chromium } from 'playwright';
import fs from 'node:fs/promises';

const urls = [
  'https://example.com/account',
  'https://example.com/reports',
];
const statePath = 'playwright/.auth/state.json';

await fs.mkdir('playwright/.auth', { recursive: true });
const browser = await chromium.launch({ headless: false });

try {
  let context;
  try {
    await fs.access(statePath);
    context = await browser.newContext({ storageState: statePath });
  } catch {
    context = await browser.newContext();
    const page = await context.newPage();
    await page.goto('https://example.com/login');
    console.log('Complete the approved sign-in flow in the browser.');
    await page.waitForURL('**/account', { timeout: 0 });
    await page.getByRole('heading', { name: 'Account' }).waitFor();
    await context.storageState({ path: statePath });
    await page.close();
  }

  const page = await context.newPage();
  for (const [index, url] of urls.entries()) {
    await page.goto(url, { waitUntil: 'domcontentloaded' });
    await page.getByRole('heading').first().waitFor();
    const filename = `screenshots/page-${index + 1}.png`;
    await fs.mkdir('screenshots', { recursive: true });
    await page.screenshot({ path: filename, fullPage: true });
    console.log(`Saved ${url} to ${filename}`);
  }
  await context.close();
} finally {
  await browser.close();
}

The URL pattern, login address, and heading in this example are placeholders for the target application’s real routes and authenticated UI. If sign-in finishes at a different URL, change the waitForURL condition; choose a reliable signed-in element rather than relying only on a redirect. The screenshot call uses fullPage: true; remove that option for a viewport-only capture.

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

Playwright documents this save-and-reuse pattern in its authentication guide and explains page capture options in its visual comparisons documentation.

#1 Best Overall

State, security, and sign-in limits

What saved browser state can contain

Depending on the application, authentication may use cookies, local storage, IndexedDB, or passkeys (WebAuthn). Playwright storage-state reuse covers these categories. Session storage is different: it is domain-specific, does not persist across page loads, and has no built-in persistence in Playwright’s standard storage-state workflow. The authentication guide describes a custom save-and-restore approach for session storage.

Treat the state file as a credential

Playwright warns: “The browser state file may contain sensitive cookies and headers that could be used to impersonate you or your test account.” Keep the file private, restrict access, exclude the authentication directory from version control, and remove or refresh the state when it is no longer needed. Add the directory to .gitignore, for example:

Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.
echo 'playwright/.auth/' >> .gitignore

Challenges and expiration

Saved state is not a permanent sign-in. If a session expires or a destination rejects it, authenticate again and save fresh state. MFA, CAPTCHA, conditional access, and provider-specific controls depend on the application’s authentication model and policies; saved state is not a universal way around them. Follow the site’s documented sign-in flow and the account owner’s rules.

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.

Make captures consistent and useful

  • Use a stable environment. Playwright notes that rendered images can vary with operating system, browser version, settings, hardware, power conditions, and headless mode. Keep the execution environment consistent when comparing captures.
  • Wait for meaningful page readiness. domcontentloaded only marks an early navigation milestone. For dynamic pages, wait for a page-specific selector or another condition that indicates the content you need has rendered.
  • Use distinct output names. The example numbers files by position in the URL list. For large lists, use a URL-derived name while sanitizing characters that are unsafe in filenames.
  • Check access, not just image creation. A successful screenshot call can still capture a login or error page. Inspect the resulting images or assert a page-specific authenticated marker before capture.
  • Choose the format deliberately. Playwright screenshots are PNG by default; WebP can be requested by using a filename with the .webp extension.

When captures are part of automated tests, Playwright’s PageAssertions screenshot API provides a test-runner-oriented comparison option; it is different from simply saving a page image.

Rank #3
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

  • The capture shows the login page. The state may not have been saved after redirects settled, may have expired, or may not apply to that URL or domain. Wait for a final URL or authenticated element before saving, then sign in again if needed.
  • One URL works but another does not. Confirm the account is authorized for both destinations and that the application accepts the same state across their routes or domains. A successful sign-in on one page does not establish access to another.
  • The state file exists but sign-in is lost. The app may rely on session storage or another application-specific mechanism outside the standard persisted state. Check the app’s authentication behavior and Playwright’s session-storage guidance.
  • The script waits forever during login. Its example uses an unlimited URL wait so a person can complete interactive steps. If the site redirects elsewhere after sign-in, update the expected URL and authenticated marker. Do not remove a required interactive challenge to force automation through.
  • Images differ between runs. Keep browser version and host environment stable, and account for dynamic content such as timestamps or rotating banners. Review the output rather than assuming identical rendering.
  • The screenshot is incomplete. A page may render content after the initial navigation event. Wait for the relevant selector or content-specific readiness condition before calling screenshot.

Or skip the browser setup

For ordinary publicly accessible pages, ScreenshotNeo can return a screenshot with one request. It is a screenshot API and MCP server; it does not replace an authorized SSO login or guarantee access to pages that require an authenticated session.

For SSO-protected pages, use the Playwright workflow above. For a page the service can access, this cURL request saves a WebP screenshot; create an API key first and replace the target URL as needed. See the ScreenshotNeo documentation for request options.

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

ScreenshotNeo accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

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

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$245.99
Bestseller No. 2
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$285.00

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
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.