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
- 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.
- 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.
- 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.
- Save state securely. Store the browser state in a private file excluded from version control.
- Restore state and capture each URL. Navigate to each destination, wait for its intended state, and save a distinct image file.
- 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.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Playwright documents this save-and-reuse pattern in its authentication guide and explains page capture options in its visual comparisons documentation.
#1 Best Overall
- 14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
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
- 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.
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.
domcontentloadedonly 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
.webpextension.
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
- 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.
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.
Recommended Free Tools
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Quick Recap
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.




