Recommended Free Tools
To capture lazy-loaded images in Selenium, scroll through the page to trigger loading, wait for the images you need to finish loading successfully, then take the screenshot. A completed driver.get() alone does not guarantee that JavaScript-driven content or images are ready.
Use this Python workflow
This example opens a page, scrolls through its document, waits up to 20 seconds for ordinary image elements to load successfully, returns to the top, and saves a viewport screenshot. Set URL to the page you want to capture.
As an Amazon Associate I earn from qualifying purchases.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
URL = "https://example.com"
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options)
try:
driver.get(URL)
def trigger_lazy_content(driver, step=600):
height = driver.execute_script(
"return document.documentElement.scrollHeight"
)
y = 0
while y < height:
driver.execute_script("window.scrollTo(0, arguments[0])", y)
y += step
# Recheck because pages can grow as content loads.
height = driver.execute_script(
"return document.documentElement.scrollHeight"
)
driver.execute_script(
"window.scrollTo(0, document.documentElement.scrollHeight)"
)
trigger_lazy_content(driver)
WebDriverWait(driver, 20).until(lambda d: d.execute_script("""
return Array.from(document.images).every(
img => img.complete && img.naturalWidth > 0
)
"""))
driver.execute_script("window.scrollTo(0, 0)")
driver.save_screenshot("page.png")
finally:
driver.quit()
Install Selenium and configure a compatible browser and driver before running the script. The code uses Chrome; the scrolling and readiness checks are browser-page JavaScript and can be adapted for other Selenium-supported browsers. The wait is intentionally bounded: if an image never loads, Selenium raises a timeout instead of silently saving a capture as though every image were ready.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Why scrolling and explicit waits matter
Navigation completion is not visual readiness
Selenium’s pageLoadStrategy controls when navigation returns: normal waits for the document’s complete ready state, eager for interactive, and none does not wait for document readiness. Even a complete ready state does not establish that a JavaScript application has finished updating its page. Use a wait tied to the content needed in the screenshot. See Selenium Browser Options.
#1 Best Overall
Lazy loading depends on proximity or application behavior
Native lazy-loaded images are generally fetched when the browser considers them near the viewport. Scrolling brings below-the-fold images close enough to trigger those requests. Applications may also load content through JavaScript, such as visibility-observer logic; they may need a particular interaction or a more specific readiness condition. MDN’s lazy-loading overview describes the browser behavior.
Check success, not just completion
img.complete becomes true when fetching has ended, including when a fetch failed. Pairing it with img.naturalWidth > 0 checks that ordinary image data is available. If the screenshot depends on decoded pixels being ready to paint, an image’s decode() promise can provide a more specific signal. See MDN on complete and MDN on decode().
Rank #2
Choose viewport or full-page output
driver.save_screenshot() captures the current browsing context, typically the visible viewport. Trigger lazy loading before either type of capture; expanding a page for a full-document image does not necessarily run the page’s scroll-triggered loading logic.
- Viewport: scroll through the document to load the images, return to the desired position, then call
save_screenshot(). - Full document: scroll and wait first, then use a full-page capture method supported by your installed browser and Selenium version. Selenium’s Python API documents
get_full_page_screenshot_as_filefor Firefox, which saves a full-document PNG. Check support for your browser combination in the Selenium screenshot documentation.
# Firefox full-document example, after scrolling and waiting:
driver.get_full_page_screenshot_as_file("page-full.png")
Return to the top before capture when the selected method or page behavior depends on the current scroll position. For a full-page result, confirm that the chosen browser method actually captures the full document rather than only the viewport.
Rank #3
Adapt the readiness check to the page
Ignore images that do not matter
The all-images condition in the example will time out if any image is intentionally broken, inaccessible, or unrelated to the portion being captured. Instead, wait for the specific images or elements that matter. For example, use a CSS selector for a gallery or article region and check only its images. Decide explicitly how to handle a failed target image: fail the capture, or proceed while recording that it was unavailable.
Handle content beyond ordinary image elements
document.images covers ordinary <img> elements, not every visual asset. CSS background images, images in nested scroll containers, and content revealed only by a click need separate handling. Scroll the relevant container, perform the required interaction, and wait for a page-specific condition. A generic delay can be flaky and does not tell you whether the needed content loaded.
Rank #4
Bound scrolling on expanding pages
The example rereads document height because loading content can make a page grow. An infinite-scroll page may never stop growing, so replace the height-based loop with a stopping rule suited to the task—for example, stop after a known target element appears or after the required section has been reached. Keep both scrolling and waits bounded to avoid a capture that runs indefinitely.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteTroubleshooting
| Symptom | Likely cause | What to change |
|---|---|---|
| Images are missing below the fold | The page was captured before those images were brought near the viewport. | Scroll through the relevant document area before waiting and capturing. |
| The wait times out even though the screenshot looks usable | An unrelated or intentionally broken image has naturalWidth of zero. |
Narrow the condition to the target content, or handle failed images explicitly instead of requiring every image on the page to succeed. |
| The page keeps growing and the scroll loop does not finish | Infinite scrolling or ongoing content expansion prevents a final document height. | Use a task-specific stop condition, such as reaching the last required section, and impose a maximum duration or number of scrolls. |
| Images are still absent after scrolling | The site may use application-specific triggers, a nested scroll container, or an interaction before loading content. | Scroll the correct container, perform the necessary interaction, and wait for the relevant page element or image state. |
| The output contains only the visible area | The chosen screenshot call captures the current browsing context rather than the full document. | Use a documented full-page method available for your browser and Selenium version, such as Firefox’s Python full-page method, and verify the resulting capture scope. |
Or skip the browser setup
ScreenshotNeo offers a one-request screenshot API; its documentation covers the request options. For example:
Quick Recap
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
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.

