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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk7 min

How to Capture Selenium Screenshots of Infinite-Scrolling Websites

Selenium screenshots capture the current browser state, not every item in an infinite feed. Scroll the correct container, wait for progress, stop safely, then capture the loaded content.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Load the content before you capture it: Selenium’s screenshot command captures the browser’s current state, but it does not make an infinite-scroll page fetch later items. Scroll the page’s actual scrolling container, wait for a meaningful change, and stop when you reach a defined end condition or the content you need. Then take a viewport screenshot or, with the appropriate Firefox Python API, a full-document screenshot.

Why scrolling and screenshotting are separate steps

A normal Selenium screenshot captures the current browsing context; it does not automatically scroll through the page or trigger every lazy-loaded item. Selenium also supports screenshots of individual elements. See the Selenium WebDriver documentation and the Selenium Python API reference.

As an Amazon Associate I earn from qualifying purchases.

For an infinite feed, first use WebDriver to scroll and wait for content to load. Only then capture. A full-document screenshot changes the capture extent, not the page’s loading behavior.

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

Build a bounded scroll-and-capture workflow

  1. Load the page and wait for initial content. Use a condition tied to the page, such as the presence of a feed item, instead of assuming that navigation means rendering is complete.
  2. Find the real scrolling container. Many pages scroll the document, but feeds inside panels may scroll within a separate element. Inspect the target page’s DOM and scroll the element that owns the feed.
  3. Scroll, then wait for progress. Record an observable value—such as item count, scroll height, or the last item—before scrolling. Afterward, wait for that value to change or for a loading indicator to disappear.
  4. Use a finite stop rule. Stop at an end marker, after the requested amount of content has loaded, or after a bounded number of checks produce no new items. Do not run an unlimited loop: some feeds never expose a definitive end.
  5. Capture and verify. Take the screenshot after the desired content is present. Inspect the image for missing items, overlaps, or layout shifts.

WebDriver can execute JavaScript, which lets you inspect dimensions or issue scroll commands; the correct target and progress condition depend on the site. The Selenium references describe the supported WebDriver capabilities, not a universal infinite-scroll loop.

#1 Best Overall
Dell Optiplex 3060 Desktop Computer | Intel i5-8500 (3.2) | 32GB DDR4 RAM | 1TB SSD Solid State | Built in WiFi | Bluetooth | Windows 11 Professional | Home or Office PC (Renewed)
  • [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
  • [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
  • [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
  • [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
  • [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)

Python example: scroll the document and wait for new items

This example assumes the document itself scrolls and that feed entries match the CSS selector .feed-item. Replace that selector with one from the target page. The loop is deliberately bounded: it stops when the feed item count no longer increases after scrolling, or when it reaches the maximum number of attempts.

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException

url = "https://example.com/feed"
item_selector = ".feed-item"  # Replace with the page's item selector
max_scrolls = 20

options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options)

try:
    driver.get(url)
    wait = WebDriverWait(driver, 15)
    wait.until(lambda d: len(d.find_elements(By.CSS_SELECTOR, item_selector)) > 0)

    for _ in range(max_scrolls):
        before = len(driver.find_elements(By.CSS_SELECTOR, item_selector))
        driver.execute_script("window.scrollTo(0, document.documentElement.scrollHeight);")

        try:
            wait.until(
                lambda d: len(d.find_elements(By.CSS_SELECTOR, item_selector)) > before
            )
        except TimeoutException:
            break

    driver.save_screenshot("feed.png")
finally:
    driver.quit()

The example uses Chrome for the scrolling workflow and saves a viewport screenshot as feed.png. It does not claim to capture the entire document in one image. The selector, wait, and stopping condition must match the site: if it has a reliable end marker, waiting for that marker can be more appropriate than stopping when the item count stalls.

When the feed uses a nested scroll container

If a panel or feed element has its own scrollbar, scrolling window will not advance it. Identify the container in the DOM, then measure and scroll that element. For example, after setting container_selector to the correct CSS selector:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)
container_selector = ".feed-container"  # Replace with the actual scrolling element
container = driver.find_element(By.CSS_SELECTOR, container_selector)

before = len(driver.find_elements(By.CSS_SELECTOR, item_selector))
driver.execute_script(
    "arguments[0].scrollTop = arguments[0].scrollHeight;",
    container,
)

wait.until(
    lambda d: len(d.find_elements(By.CSS_SELECTOR, item_selector)) > before
)

Use the same bounded-loop approach as the document example, re-finding the container if the page replaces it during loading. If scrolling to the bottom does not change the feed, confirm that the selected element is the one with the scrollbar and that the wait condition represents actual new content.

Choose the screenshot method after loading

Viewport screenshot

Use Selenium’s ordinary screenshot method when one viewport is enough. In Python, driver.save_screenshot("feed.png") saves the current window as a PNG. The general Python WebDriver reference also documents screenshot data as PNG bytes. See the Selenium Python WebDriver API.

Firefox full-document screenshot

The Firefox Python WebDriver API documents methods to save a full-document screenshot or return its PNG bytes or base64 data. This can produce one tall image after the content is loaded, but it does not itself cause the page to load its lazy items. Confirm that your chosen browser and Selenium binding support the method. See the Firefox WebDriver API documentation for Selenium 4.50.0.

Rank #3
Sale
HP All-in-OneDesktop Computer, 16GB DDR5 RAM, Intel Quad-Cores, 128GB SSD, WiFi6, Keyboard & Mouse, Windows 11
  • IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
  • POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
  • GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
  • ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
  • ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.

Capture long or virtualized feeds in sections

A very long full-page image may be unwieldy. More importantly, some virtualized feeds remove off-screen entries from the DOM as new ones appear. A final full-document capture can then omit earlier content. In that case, capture successive viewports as the feed advances and store separate images or combine them afterward. Inspect the result for gaps and overlaps.

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

Common failures and fixes

  • The screenshot shows only the first items: The screenshot command captures the current state; it does not load later content. Scroll first, wait for a content change, and capture afterward.
  • Scrolling does not move the feed: The page may use a nested scroll container. Inspect the DOM and scroll the element that owns the feed rather than the window.
  • The loop stops too soon: The wait condition may track the wrong selector or an item count that is not updated in place. Choose a meaningful page-specific signal, such as a known loading state or the last item changing.
  • The loop never stops: Use a maximum number of attempts, a target item count, or an end marker. Infinite-scroll pages may not provide a terminal signal.
  • Earlier items are missing from the tall screenshot: The page may virtualize its feed by removing off-screen items. Capture sections while scrolling instead of relying on a final document capture.
  • The image has overlaps or inconsistent spacing: Sticky headers, late-loading images, ads, animations, or other layout shifts can change the page during capture. Wait for the relevant content to settle and inspect the output.
  • A full-document method is unavailable: Full-document capture is browser- and binding-specific. Check the chosen browser’s Selenium documentation; use viewport or section captures if the method is not supported.

Performance, reliability, and reproducibility

Scrolling and waiting add time, especially when each step waits for network-loaded content. A fixed sleep is simple but may waste time on a fast load and still be too short on a slow one. An explicit wait for a content or loading-state change is usually a more useful signal, though it still needs a site-appropriate timeout.

For repeatable captures, record the browser, driver, viewport size, selector used for the feed, and stopping condition. Dynamic pages can change between runs, so visually verify that the output contains the intended items and has no missing sections or unexpected layout shifts.

Rank #4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
  • This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
  • Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
  • Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
  • Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
  • Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
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. Its one-request API can return a screenshot or PDF, but a screenshot of an infinite-scroll page still depends on the target content being available to capture; the API call below does not document an infinite-scroll loading loop.

For a page that is ready to capture, one request looks like this (see the ScreenshotNeo API documentation):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status.
  • 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
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
  • Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
  • Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
  • Storage: Combines 500GB SSD and 1TB HDD for ample storage space
  • Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
  • Design: Sleek desktop tower with black color and slim profile for modern look

Frequently Asked Questions

Does Selenium scroll an infinite page when I call its screenshot method?

No. Scrolling and waiting for the page to load content are separate from taking a screenshot.

Can Selenium’s Firefox full-document screenshot load lazy content for me?

No. It changes the capture extent; you still need to scroll and load the content first.

Why can a full-page screenshot omit items I saw while scrolling?

A virtualized feed may remove off-screen entries from the DOM. Capture sections as you move through it.

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

Quick Recap

Bestseller No. 2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Model: Dell OptiPlex 7050 Small Form Factor (SFF); Processor: Intel Core i7-7700 3.60 GHz; Memory: 32GB DDR4 Ram
$384.00
Bestseller No. 4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.; Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
$189.99
Bestseller No. 5
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections; Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
$269.99

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
Crashes, No Sound, or Screen Glitches?Free driver scan
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.