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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Log in through the site’s permitted authentication flow, confirm that member-only content has rendered, then capture it with await page.screenshot({ path: 'member-page.png', fullPage: true }). The explicit fullPage: true setting captures the full page rather than Puppeteer’s default viewport-sized screenshot. Authentication and readiness checks must match the site; reaching the page URL alone does not prove that login succeeded.

Use a login method that matches the site

Members-only pages may use different authentication mechanisms. Choose the one the site actually supports, and use only an account and access method you are authorized to use.

HTML login form

Navigate to the login page, fill the site’s actual fields, and submit its form. The selectors and any additional steps depend on the site; there is no universal Puppeteer form selector. After submission, wait for a reliable sign of access, such as a member navigation item or a protected-content element. Do not assume a successful navigation means the login worked.

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

HTTP authentication

page.authenticate({ username, password }) supplies credentials for HTTP authentication. It is not a general-purpose way to fill and submit an HTML login form. Puppeteer notes that authentication enables request interception behind the scenes, which may affect performance. See the Page.authenticate reference.

Existing cookie-backed session

If you already have a valid session, restore its cookies in the browser context before navigating to the protected page. Cookie domain, path, security and expiration attributes matter; session cookies can expire, and some applications also depend on local storage or server-side state. Prefer browser or browser-context cookie APIs: Puppeteer’s page-level cookie APIs are deprecated. See the cookies guide and Page API reference. Browser contexts isolate cookies and other storage, which is useful when keeping separate accounts or tasks apart.

Runnable Puppeteer flow

This example shows the sequence for a site where you have implemented its permitted login flow. Replace the URLs and selectors with the target site’s real values; the sample does not perform a real login.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com/login', {
    waitUntil: 'domcontentloaded',
  });

  // Perform the site's permitted HTML form login here,
  // or restore a valid session before navigating to the member page.

  await page.goto('https://example.com/members/article', {
    waitUntil: 'networkidle2',
  });
  await page.waitForSelector('[data-member-content]');

  await page.screenshot({ path: 'member-page.png', fullPage: true });
} finally {
  await browser.close();
}

Keep credentials and session material out of committed source code. Load secrets from deployment environment variables or a secure secret store. In production, the finally block ensures the browser is closed even when login, navigation or capture fails.

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.

Verify the page before saving

The official Puppeteer screenshot guide demonstrates waiting for navigation with networkidle2. That can be useful, but network idleness is not proof that a particular site has finished rendering member content. Wait for a site-specific selector that appears only after successful access, and, where useful, check the final URL or another page-specific signal as well. Choose a wait condition that fits the site rather than assuming one is universally reliable.

Long pages may load images or sections lazily as they scroll. Inspect the resulting screenshot; if content is missing, trigger the site’s normal lazy-loading behavior before capture. fullPage: true does not guarantee that every application-specific loader will run. Puppeteer’s guide also documents navigation waits and full-page screenshots: Screenshots guide.

Capture the full page or just an element

For the whole document, use page.screenshot({ path: 'member-page.png', fullPage: true }). In Puppeteer 25.12.0, fullPage is optional and defaults to false, so set it explicitly. The same version’s ScreenshotOptions reference says captureBeyondViewport defaults to false without a clip and true with a clip. Avoid adding clip when you want the whole page rather than a cropped region. See ScreenshotOptions.

If you only need a component, use an element screenshot instead of capturing the entire document. Puppeteer’s ElementHandle.screenshot reference says it scrolls the element into view if it is hidden.

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

Troubleshoot missing or incorrect captures

  • You saved a login or access-denied page: Check the final URL and wait for a member-only selector before saving. Revisit the site’s actual login process or confirm that restored cookies are still valid.
  • page.authenticate() did not log in: That method handles HTTP authentication, not arbitrary HTML forms. Use the site’s own form flow for form-based login.
  • Restored cookies do not grant access: Confirm their domain, path, security and expiry attributes. The site may require additional browser storage or server-side state, so cookies alone may not be sufficient.
  • The screenshot is cut off: Set fullPage: true and remove clip unless you intentionally want a crop.
  • Some page content or images are missing: Wait for the content-specific selector and check whether the page uses lazy loading. Trigger the site’s normal loading behavior when needed, then inspect the output.
  • The browser stays running after an error: Put capture work inside try and close the browser in finally.
  • Very long pages fail or consume substantial resources: Image dimensions and browser memory can become operational limits, but there is no single maximum established here; it depends on the browser build, page content and environment.
  • Login stops at MFA, CAPTCHA or an anti-automation check: These steps are site-specific. Use the site’s permitted access flow; do not guess selectors or assume a universal workaround.
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 already have legitimate access to a page, ScreenshotNeo can capture a URL with one GET request. For a member-only page, the target still needs to be accessible to the capture request; a URL alone does not transfer your browser’s authenticated session.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API docs for request options. ScreenshotNeo accepts consent banners like a visitor and removes 60+ known consent platforms, newsletter popups and chat widgets before capture; those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and responses identify the page verdict and billing status. Its MCP server provides screenshot tools for Claude, Cursor and other MCP clients. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo. Sign up free for 1,000 screenshots a month, with no card required.

Frequently Asked Questions

How do I take a full-page screenshot after logging in with Puppeteer?

After confirming that a member-only selector is present, call await page.screenshot({ path: 'page.png', fullPage: true }).

Can I screenshot only one part of a members-only page?

Yes. Use Puppeteer’s element screenshot API for the target element instead of a full-page capture.

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.