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 desk6 min

How to Schedule Website Screenshots at a Fixed Scroll Position

Automate a browser screenshot at a chosen scroll position with Playwright, then schedule recurring runs using GitHub Actions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a browser automation script to open the page, scroll to a chosen vertical offset, wait for the content you need, and capture the visible viewport. Then schedule that script with a recurring workflow such as GitHub Actions. A normal Playwright screenshot captures the current viewport; fullPage captures the entire scrollable page instead. [Playwright: Screenshots] [Playwright: Page API]

What a fixed-scroll screenshot captures

A fixed-scroll screenshot records the viewport after the page has been moved to a specific vertical position. It is useful when you want recurring images of the same section, such as a product listing or dashboard. It is not a special screenshot mode: your script must set the scroll position before it captures the page.

By contrast, a full-page screenshot captures the complete scrollable document as a tall image. Choose viewport capture when the visible region at a specific offset is the desired output; choose full-page capture when you need the whole page. [Playwright: Screenshots] [Playwright: Page API]

Set up a repeatable Playwright capture

Install Playwright

For a Node.js project, install Playwright and its browser:

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.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
npm init -y
npm install playwright
npx playwright install chromium

Write the capture script

Save this as capture.mjs. Replace the URL and offset with your target values. This example uses a 1440 by 900 CSS-pixel viewport and writes a PNG image.

import { chromium } from 'playwright';

const url = 'https://example.com';
const scrollY = 1200;
const output = `screenshot-${new Date().toISOString().replaceAll(':', '-')}.png`;

const browser = await chromium.launch({ headless: true });
try {
  const page = await browser.newPage({
    viewport: { width: 1440, height: 900 },
    deviceScaleFactor: 1,
  });

  await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
  // Prefer a meaningful page condition to assuming a fixed delay means readiness.
  await page.locator('body').waitFor({ state: 'visible', timeout: 15000 });
  await page.evaluate((y) => window.scrollTo(0, y), scrollY);
  await page.screenshot({ path: output, type: 'png' });
  console.log(`Saved ${output}`);
} finally {
  await browser.close();
}

The script explicitly scrolls after navigation and before the screenshot. Playwright’s ordinary page screenshot captures the current viewport; omit fullPage to keep the output limited to that viewport. [Playwright: Page API]

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Wait for the right page state

domcontentloaded means the document has been parsed, not that every image, animation, or application update has finished. If the content matters, wait for a stable selector or other task-specific condition before scrolling and capturing. A fixed sleep can be useful for a known delay, but it is not proof that network activity or animations have settled.

For a dynamic page, add a selector wait such as await page.locator('[data-test="results"]').waitFor({ state: 'visible' }); and use a selector that actually identifies the content on your site. If the page updates after that element appears, wait for the update’s completion condition too.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Use a recurring GitHub Actions workflow

GitHub Actions scheduled workflows use POSIX cron. GitHub’s documentation says schedules default to UTC, accept an IANA time zone, and have a minimum interval of five minutes. Scheduled workflows run on the latest commit on the repository’s default branch. [GitHub Docs: Events that trigger workflows]

Add the workflow file

Commit the capture script and package files, then add .github/workflows/site-screenshot.yml. This example schedules a capture each day at 09:30 UTC and also allows a manual run from the Actions tab.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2Ă— USB C male to USB A female adapters and 2Ă— USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
name: Scheduled website screenshot

on:
  schedule:
    - cron: '30 9 * * *'
  workflow_dispatch:

jobs:
  capture:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: node capture.mjs
      - uses: actions/upload-artifact@v4
        with:
          name: website-screenshot
          path: screenshot-*.png
          if-no-files-found: error

Adjust the cron expression for the cadence and time you need. If you use a timezone other than UTC, set it using the schedule’s supported timezone configuration documented by GitHub. Keep the workflow on the default branch; a schedule in another branch will not serve as the active scheduled workflow.

Account for scheduling limits

A cron expression requests a schedule; it does not guarantee execution at the exact minute. GitHub warns that high load can delay scheduled workflows and that queued jobs may be dropped under sufficient load. Public repositories with no activity for 60 days have scheduled workflows automatically disabled. If exact execution time or stronger delivery guarantees matter, select a scheduler suitable for that requirement and monitor completed runs rather than relying on the expression alone. [GitHub Docs: Events that trigger workflows]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep recurring images comparable

  • Keep viewport and scale fixed. Use the same viewport width, height, and device scale factor across runs. Playwright supports CSS-pixel and device-pixel screenshot scaling; the selected scale affects output dimensions. [Playwright: Screenshots] [Playwright: Page API]
  • Use the same offset. Record the chosen vertical position in the script or configuration, and make sure the page has reached the same state before scrolling.
  • Handle moving content deliberately. Animations, timestamps, rotating banners, and overlays can make images differ between runs. Playwright documents screenshot styling and animation controls that can help suppress or adjust dynamic elements. [Playwright: Page API]
  • Save and inspect run outputs. Use timestamped filenames or a deterministic run identifier. Keep the workflow logs and surface failed runs through your normal monitoring or notification setup.

When the target is inside a scrollable element

window.scrollTo() moves the document viewport. It does not set the scroll position of an independent panel, menu, or other nested scroll container. Scroll the target element itself when that is where the content moves. For example:

const panel = page.locator('.results-panel');
await panel.evaluate((element) => { element.scrollTop = 600; });
await panel.screenshot({ path: 'panel.png' });

An element screenshot shows the element’s currently scrolled content, rather than automatically expanding it to include all of its off-screen content. [Playwright Python: Screenshots]

Troubleshooting

  • The screenshot shows the top of the page. Confirm the scroll runs after navigation and after any page action that resets the position. Check that you are scrolling the document, not a nested container.
  • The capture is blank or missing content. Wait for the specific content to become visible or finish updating before taking the screenshot. A parsed document can still lack asynchronously rendered content.
  • The screenshot changes size or framing between runs. Fix the viewport dimensions and device scale factor, and keep the capture mode consistent. Do not switch between viewport and full-page capture if you need identical output scope.
  • The scheduled run does not happen at the expected minute. GitHub scheduling can be delayed during high-load periods, and queued jobs can be dropped. Inspect the Actions run history and avoid relying on an exact-time guarantee.
  • The scheduled workflow stops running in a public repository. Check whether the repository has had activity within the last 60 days; GitHub automatically disables schedules for inactive public repositories.
  • The job fails to launch Chromium in CI. Install the browser and its operating-system dependencies in the workflow with npx playwright install --with-deps chromium, and inspect the failed step’s logs.

Or skip the browser setup

For a screenshot API call, use ScreenshotNeo’s API documentation. Set the viewport and scroll position supported by your capture workflow; an API call does not replace the need to decide which page state and offset you want.

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, and lets you turn each cleanup step off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed; response headers identify the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo or sign up for 1,000 free screenshots a month, with no card.

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

Frequently Asked Questions

Can I schedule a capture every five minutes with GitHub Actions?

Yes. GitHub documents a shortest schedule interval of once every five minutes, though actual starts can be delayed.

Does a fixed scroll offset capture the same content on every run?

Only if the page state, layout, viewport, and content remain sufficiently consistent; a fixed offset does not anchor to a particular element.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5Ă— more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
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.