Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

How to Screenshot a Website Behind a Login Without Capturing the Sign-In Page

Wait for the authenticated destination and a signed-in page landmark before capturing. This Playwright guide shows reusable login state, capture scopes, masking, security, and fixes for screenshots that keep showing the sign-in page.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a browser that is already signed in, wait for the site to finish redirecting, confirm a page-specific signed-in element is visible, and only then take the screenshot. With Playwright, save the authenticated browser state after login and load it into the context used for capture. This prevents an early screenshot from capturing the sign-in form instead of the page you need.

Capture the authenticated page, not the login screen

The important check is not merely that the login button was clicked. Sites may redirect several times while establishing a session. Wait for the final destination and verify a stable signed-in landmark—such as the expected page heading or account control—before capturing.

As an Amazon Associate I earn from qualifying purchases.

The workflow below uses Playwright with JavaScript. It assumes you can log in to the site with an account you are authorized to use. Playwright’s authentication guide recommends saving browser state for reuse; its Page API documents screenshot options.

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.

Set up a reusable Playwright login

Install Playwright

In a new project, install Playwright and its Chromium browser:

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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
npm init -y
npm install -D playwright
npx playwright install chromium

Log in once and save browser state

Create save-auth.js. Replace the example URLs and selectors with the site’s login page, credentials, and a locator that only appears after a successful login. This example enters credentials directly; for an account protected by multi-factor authentication or another interactive challenge, complete that step in the opened browser before saving state.

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

(async () => {
  const browser = await chromium.launch({ headless: false });
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto('https://example.com/login');
  await page.locator('#email').fill(process.env.SITE_EMAIL);
  await page.locator('#password').fill(process.env.SITE_PASSWORD);
  await page.locator('button[type="submit"]').click();

  // Wait for a real signed-in landmark, not just the button click.
  await page.getByRole('heading', { name: 'Dashboard' }).waitFor();
  await page.waitForURL('https://example.com/dashboard');

  await context.storageState({ path: 'playwright/.auth/user.json' });
  await browser.close();
})();

Set SITE_EMAIL and SITE_PASSWORD in your environment before running the script. Do not hard-code credentials in a script committed to version control. Create playwright/.auth before running it, and add that directory to .gitignore:

mkdir -p playwright/.auth
echo 'playwright/.auth' >> .gitignore
SITE_EMAIL='[email protected]' SITE_PASSWORD='your-password' node save-auth.js

Adjust the URL wait if the site uses a different final address or a redirect pattern. A heading wait is only an example: choose a locator that reliably indicates the authenticated state on the page you intend to capture.

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

Load the saved state and take the screenshot

Create capture.js. The script loads the state into a new context, visits the protected page, checks both the final URL and a signed-in landmark, and then captures the requested scope.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext({
    storageState: 'playwright/.auth/user.json',
    viewport: { width: 1440, height: 1000 }
  });
  const page = await context.newPage();

  await page.goto('https://example.com/dashboard/reports', {
    waitUntil: 'domcontentloaded'
  });
  await page.waitForURL('https://example.com/dashboard/reports');
  await page.getByRole('heading', { name: 'Reports' }).waitFor();

  await page.screenshot({ path: 'authenticated-page.png' });
  await browser.close();
})();

Run it with node capture.js. If the page loads client-side content after the initial document, the landmark wait helps avoid capturing too early. Use the page’s actual URL and a selector that is specific to its signed-in interface.

Choose the right capture scope

Capture Use it when Trade-off
Viewport The information fits in the visible browser window. Does not include content below the fold; keeps the image manageable.
Full page You need the full scrollable page. Can produce a very tall image and include unrelated or private content farther down.
Element You need one chart, table, panel, or other component. Requires a reliable locator for the element.

For full-page capture, use await page.screenshot({ path: 'full-page.png', fullPage: true });. For a component, call the locator’s screenshot method, for example await page.locator('[data-testid="report-chart"]').screenshot({ path: 'chart.png' });. Playwright also supports a clipping rectangle and masking selected locators. Its screenshot documentation notes that full-page capture cannot be combined with targeting a single element in the screenshot tool.

For example, mask a private account label while capturing the viewport:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.screenshot({
  path: 'redacted.png',
  mask: [page.locator('[data-testid="account-name"]')]
});

Inspect the resulting file: confirm the mask covers the sensitive content without hiding information the screenshot is meant to show. If only one part of a page is relevant, an element capture may expose less than masking a full-page image.

Rank #3
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.

Protect the saved session and the screenshot

Playwright warns: “The browser state file may contain sensitive cookies and headers that could be used to impersonate you or your test account.” Treat the state file as authentication material, not as a harmless test setting.

  • Keep playwright/.auth out of source control, including private repositories.
  • Restrict access to the machine, storage location, and build artifacts that contain the state file.
  • Review screenshots before sharing: authenticated pages can show account names, records, customer information, or other private data.
  • Use masking or a narrower capture target when the full page is not needed.

Why does my screenshot keep showing the login page?

The login has not finished

A click on “Sign in” does not prove authentication completed. Wait for the final URL and a signed-in element, as in the scripts above. If the site redirects through several pages, use a URL condition that matches the actual final destination.

The saved state does not include what this site needs

Playwright’s reusable state covers cookies, local storage, IndexedDB, and passkey-based authentication. Session storage is a less common exception: it is domain-specific and is not persisted across page loads by default. If the site relies on it, the ordinary saved-state workflow may not be sufficient; determine how that site establishes the session and handle the storage deliberately.

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

The state came from a different browser

Do not assume authentication state captured in one browser can be reused in another. Playwright identifies browser-specific authentication as a reason not to use a shared-state setup. Save and use the state with the browser configuration your automation actually runs.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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

The screenshot is too tall or contains the wrong content

Switch from full-page to viewport capture, or target only the relevant element. If unrelated content appears in the frame, adjust the viewport or use an element screenshot rather than capturing everything.

Private details remain visible

Add a mask for the sensitive locator or narrow the capture to the relevant component. Open the resulting image and verify the redaction before sharing it; a configured mask is not a substitute for checking the output.

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

Or skip the browser setup

If you need an API call rather than a Playwright browser workflow, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return an image or PDF, but a remote screenshot service does not receive your local Playwright session state; do not expect it to access a protected page merely because you can see that page in your browser. Use it for pages it can access or workflows configured with appropriate authorization.

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.

For an accessible page, this cURL call saves a WebP screenshot. See the ScreenshotNeo documentation for request options and response details:

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

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000.

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

FAQ

Can I screenshot a page that requires two-factor authentication?

Yes, if you complete the authentication using an account you are authorized to use and then save or use that authenticated session. The example opens a visible browser for interactive login steps.

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

Can I save a screenshot of just a chart or table?

Yes. Use a locator’s screenshot method to capture the element rather than the whole page.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.