October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Capture a Website Screenshot With a Sticky Header on Mobile

Capture a mobile sticky header at the scroll position that demonstrates its behavior. This guide shows Playwright viewport, element, and full-page methods, plus a ScreenshotNeo API option.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To show a mobile sticky header accurately, set a mobile-sized browser viewport, scroll until the header is in the state you want to document, and take a viewport screenshot. Capture at more than one scroll position if you need to show how the header changes. Use a full-page screenshot for a tall view of the document, not as a substitute for showing the header at a particular point in the scroll.

Choose the screenshot that shows the right state

A sticky header is defined by its behavior while the page scrolls. A single screenshot taken at the top may not show that behavior, so first decide what the image needs to demonstrate.

  • Header behavior while scrolling: capture the mobile viewport at the relevant scroll position. To show a change, take one image at the top and another after the header becomes sticky.
  • Header appearance only: capture the header element by itself, if your browser automation tool supports element screenshots.
  • The whole document: use a full-page screenshot when a tall image of the page is useful. It captures the full scrollable page, but may not communicate how the header looks at a specific scroll position.

Playwright documents viewport, element, and full-page screenshot modes, and describes full-page capture as a tall view of the full scrollable page. Playwright Screenshots documentation

Capture a mobile sticky header with Playwright

Playwright can emulate a mobile device context, including properties such as viewport size and touch support. Emulation is useful for repeatable captures, but it does not guarantee that every physical phone or browser will render the page identically. Playwright emulation documentation

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

As an Amazon Associate I earn from qualifying purchases.

Install Playwright

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

npm init -y
npm install -D playwright
npx playwright install chromium

Capture the header at the top and after scrolling

Save this as capture-sticky-header.js. It opens the page in a mobile-emulated context, saves a viewport screenshot at the top, scrolls down, waits for the page to settle, then saves a second viewport screenshot. Replace the example URL and adjust the scroll distance to match the point where the sticky state is visible on your page.

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

(async () => {
  const browser = await chromium.launch({ headless: true });
  const context = await browser.newContext({
    ...devices['iPhone 13'],
    deviceScaleFactor: 1
  });
  const page = await context.newPage();

  try {
    await page.goto('https://example.com', {
      waitUntil: 'networkidle',
      timeout: 60000
    });

    // Capture the initial mobile viewport.
    await page.screenshot({ path: 'header-top.png' });

    // Scroll far enough to reveal the sticky state; tune for your page.
    await page.evaluate(() => window.scrollTo(0, 500));
    await page.waitForTimeout(500);

    // Capture the viewport while the page is at the scrolled position.
    await page.screenshot({ path: 'header-scrolled.png' });
  } finally {
    await browser.close();
  }
})();

Run it with node capture-sticky-header.js. The two PNG files show the page viewport at two points in the scroll. The scroll distance and brief wait are practical defaults, not guarantees: pages can have different sticky thresholds, animation timing, or loading behavior.

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

Capture only the header element

If the goal is a close-up of the header rather than its relationship to the page, locate the header with a CSS selector and screenshot that element after scrolling:

#1 Best Overall
Sale
Motorola Moto g - 2026 | Unlocked | Made for US 4/128GB | 50MP Camera | Pantone Slipstream, Cellular_Phone
  • Universal unlocked. Compatible with all major U.S. carriers, including Verizon, AT&T, T-Mobile and other prepaid carriers.
  • Super-bright, super-smooth 6.7" display. See your screen clearly even outdoors in sunlight, and enjoy seamless views with a fast-refreshing 120Hz display.*
  • AI-powered camera system. Take stunning photos in any light with the 50MP camera**, look your best with a 32MP selfie cam*****, and capture extreme close-ups.
  • Superfast 5G performance. Unleash your entertainment at 5G speed*** with the MediaTek Dimensity 6300 chipset and up to 12GB of RAM with RAM Boost****.
  • Long-lasting battery + TurboPower charging. Power through day after day with a 5200mAh battery, then get hours of power in just minutes.****
const header = page.locator('header');
await header.screenshot({ path: 'sticky-header.png' });

Replace header with a selector that uniquely identifies the site’s sticky header. An element screenshot is not the best evidence of where the header sits in the mobile viewport; use viewport screenshots for that context.

Capture a full-page image when needed

For a tall screenshot of the entire scrollable page, use Playwright’s full-page option:

await page.screenshot({ path: 'full-page.png', fullPage: true });

This is useful for documenting page content in one image. To document sticky behavior at a chosen scroll position, use viewport captures instead. How sticky elements appear in a full-page image can depend on browser capture behavior; do not assume the tall image represents every in-scroll state.

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

Emulation or a real phone?

Use emulation when you need repeatable screenshots or want to set mobile-relevant conditions such as viewport dimensions and touch support. Playwright’s device presets provide device-like settings; you can also configure viewport and other context properties directly. For a claim about the exact appearance or behavior on a particular phone, capture or verify it on that physical device. An emulated result is not proof of identical rendering on every handset.

Rank #2
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF; for a sticky header, request a mobile viewport and choose the scroll position you want to show. The response is a screenshot of the requested page state, so use separate requests if you want to document both the top and scrolled states.

Install Python’s requests package with python -m pip install requests, then run:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={
        "access_key": "YOUR_API_KEY",
        "url": "https://example.com",
        "viewport": "iPhone 13",
        "scroll_y": 500
    },
    timeout=90
)
r.raise_for_status()
open("sticky-header.webp", "wb").write(r.content)

See the ScreenshotNeo API documentation for supported parameter names and options. The example sets a mobile preset and scroll position; check the documentation for the exact parameter names accepted by your request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Samsung Galaxy A16 5G 128GB Cell Phone, Unlocked Android Smartphone, Large AMOLED Display, Durable Design, Super Fast Charging, Expandable Storage, US Version, 2025, Blue Black (Renewed)
  • Charger NOT Included, 6.7" Super AMOLED FHD+, 90Hz Refresh Rate, 385 ppi, 800 nits (HBM), 1080x2340px, 5000mAh Battery
  • 128GB, 4GB RAM, microSDXC, Exynos 1330 (5nm), Octa-Core, Mali-G68 MP2 or Mali-G57 MC2 GPU
  • Rear Camera: 50MP, f/1.8 (wide) + 5MP, f/2.2 (ultrawide) + 2MP, f/2.4 (macro), LED flash, panorama, HDR; Front Camera: 13MP, f/2.0, Android 14, up to 6 major Android upgrades, One UI 6.1
  • 3G: HSDPA 850/900/1700(AWS)/1900/2100; 4G LTE: 1/2/3/4/5/7/12/13/14/20/25/26/28/29/30/38/39/40/41/48/66/71, 5G: 2/5/25/41/66/71/77/78 SA/NSA/Sub6/mmWave - Nano-SIM + eSIM
  • US Model – Global Connectivity – Compatible with Most GSM Carriers like T-Mobile, AT&T, MetroPCS, etc. Will Also work with CDMA Carriers Such as Verizon, Straight Talk.
  • Cookie and consent banners are accepted before capture, and 60+ known consent platforms, newsletter popups, and chat widgets can be removed; each step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Responses include X-Page-Verdict and X-Billed headers.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

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

Best Value
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
Rank #4
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Troubleshooting the capture

  • The scrolled screenshot still shows the header at the top: confirm the scroll command ran and that the page actually scrolled. Increase the scroll distance or wait for any sticky transition to finish.
  • The header is absent or different from the phone: check that the intended mobile viewport and device context are active. Emulation can approximate device conditions, but validate on the physical phone when exact behavior matters.
  • The screenshot is blank or incomplete: wait for the page’s essential content or a specific selector to appear before capturing. Some pages continue loading after the initial navigation event.
  • The full-page capture does not show the sticky state you expected: capture the viewport at the scroll position where the sticky header is visible; a full-page image is a tall document view, not a sequence of scroll states.

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.