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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To automate screenshots with Python, write a script that opens a page in a headless browser, waits for the content you need, saves an image, and then schedule that script to run. Playwright provides the browser capture step; you can use APScheduler for recurring jobs inside a Python application or your operating system’s scheduler to launch the script at set times.

Build a Python screenshot script

The example below uses Playwright’s synchronous Python API. It captures the visible viewport and closes the browser after the image is saved. This is an illustrative starting point, not a tested script; install Playwright and its browser binary, then run the script manually before scheduling it.

  1. Install Playwright: In the Python environment you intend to use, install the Playwright package and install the browser binary required by your chosen Playwright browser. Follow the Playwright Python library guide for the current installation steps.
  2. Save the following as capture.py:
    from pathlib import Path
    from playwright.sync_api import sync_playwright
    
    URL = "https://example.com"
    OUTPUT = Path("/absolute/path/to/screenshots/example.png")
    
    
    def capture():
        OUTPUT.parent.mkdir(parents=True, exist_ok=True)
    
        with sync_playwright() as playwright:
            browser = playwright.chromium.launch()
            page = browser.new_page()
            page.goto(URL, wait_until="load", timeout=60_000)
            page.screenshot(path=str(OUTPUT))
            browser.close()
    
    
    if __name__ == "__main__":
        capture()
  3. Set the destination: Replace the example URL and output path. Use an absolute path so the script does not depend on whichever working directory the scheduler happens to use. The script creates the output directory if it does not exist.
  4. Run it by hand: Start it with the Python interpreter you installed Playwright into. Confirm that the image appears at the expected location before you add a schedule.

Playwright’s documented workflow launches a browser, navigates to a URL, captures a screenshot, and closes the browser; headless mode is the default, so a visible browser window is not required. See the Playwright screenshot guide.

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

Choose what and when to capture

Capture the viewport, full page, or one element

The example saves the current viewport. Use full-page capture if content below the fold matters, or target an individual element if you only need a particular chart, card, or other component:

#1 Best Overall
2.4G Air Remote Control with USB Receiver for Lilux for for Android-TV Box PC Air Rechargeable with Keyboard USB Pointer Pc Controller Voice Gyroscope
  • code memory, no need to set, replace the battery without losing the code, use it directly
  • and
  • The keys are sensitive, sturdy and and easy to operate. Sturdy and fall-resistant, long-term use. Good toughness, high strength, beautiful appearance and not easy to change color
  • Long-distance and all-round free remote control, and comfortable. An analog cursor makes the positioning clearer
  • 2.4G radio frequency technology, 360° remote control, USB plug and for play, 2 keys for learning
# Entire scrollable page
page.screenshot(path=str(OUTPUT), full_page=True)

# One element, selected by CSS
page.locator(".report-card").screenshot(path=str(OUTPUT))

Playwright documents both full_page=True and element screenshots. The selector must match the element you want to capture. If the page renders content after navigation, wait for the relevant condition before taking the screenshot—for example, page.locator(".report-card").wait_for() when that element indicates readiness. A page’s load event alone may not mean that every delayed image or application component is ready.

Pick an output format and scale

Playwright supports PNG, JPEG, and WebP screenshots. PNG is a lossless option; JPEG and WebP can use quality settings where supported. The screenshot API also provides scale and animation options. Choose based on the detail you need and the file size you can store, rather than assuming one format is best for every page. Disabling animations can reduce movement during capture, but does not make changing page content identical between runs. See the Playwright Page screenshot API for the available options and timeout behavior.

Schedule the script to run repeatedly

There are two common approaches. Neither is universally better: choose based on where the process will run, whether it can remain alive, how you want missed runs handled, and whether you prefer Python configuration or host-level scheduling.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach How it runs Often suits
APScheduler A Python application queues code to run later or on a recurring schedule. A service or application that already runs continuously and should manage jobs within Python.
Operating-system scheduler The host starts the standalone script at configured times; the script exits after capture. A small job that should start and finish for each scheduled run.

Use APScheduler in a running Python application

APScheduler’s user guide describes scheduling Python code for one-time or recurring execution. Add the capture function as a job in an application that stays running, and configure the recurrence there. The scheduler process must be available when the job is due; a script left in a terminal is not a reliable substitute for a managed, running application.

Rank #3
URANT 5V USB Wireless Remote Switch,3A Heavy Duty RF Controller
  • 1.[Upgraded 3A Capacity] Easily add wireless control to hard-to-reach 5V USB devices. Unlike standard 2A models, this heavy-duty USB remote switch safely supports up to a 3A max load. Plug-and-play design requires no wiring
  • 2.[Pre-Paired Latching Relay] Ready out of the box with zero programming. This RF power controller features an intuitive latching mode: press "A" for ON, and "B" for OFF. The dedicated two-button design makes this wireless inline switch highly reliable for daily use
  • 3.[164ft Through-Wall Range] Control electronics from across the house. Utilizing a strong 433MHz frequency, the long-range remote signal passes easily through walls, floors, and cabinets without line-of-sight limits. Enjoy a stable 164ft (50m) range in open areas
  • 4.[Expandable RF Signal] Customize your setup without Wi-Fi or Bluetooth. Each expandable remote switch uses independent encoding to prevent cross-talk. The learning button lets you pair multiple remotes to one receiver, or control multiple USB relays with one remote
  • 5.[Versatile Applications] A highly compatible solution for everyday electronics and DIY setups. This USB power cutoff switch is ideal for managing LED light strips, under-cabinet lighting, desk fans, and routers. Includes 1 USB receiver and 2 RF transmitters

Use your operating system’s scheduler

Configure the host to start capture.py at the times you want. Exact setup and labels vary by operating system, so use that platform’s scheduler instructions. Point it to the intended Python interpreter and script, and account for the working directory, environment variables, permissions, and retry behavior. These settings can differ from an interactive terminal session.

Make scheduled captures easier to trust

  • Avoid accidental overwrites: If you need a history, include a date and time in each output filename, or otherwise choose a naming scheme that preserves earlier captures.
  • Record outcomes: Log each run, including failures such as network errors, navigation timeouts, or missing permissions. That makes it easier to distinguish a missed schedule from a page that did not load.
  • Wait for meaningful readiness: Choose a page state or selector that reflects the content you need. A successful navigation does not guarantee that delayed images or dynamically rendered elements are ready.
  • Account for changing pages: Timestamps, animations, rotating content, and personalization can change between captures. Screenshot settings can reduce some variation, but pixel-identical output is not guaranteed unless the page and its inputs are controlled.
  • Check access: Capture only pages and data you are authorized to access. Browser automation does not bypass access rules.
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 would rather make a request than install and schedule a browser script, ScreenshotNeo is a website screenshot API and MCP server for developers. Its API takes a URL and returns an image or PDF; see the ScreenshotNeo API documentation for request options.

Best Value
Replacement Solarcell Remote for Samsung Smart TV Remote w/AI YouTube
  • 1. Eco‑Friendly SolarCell Charging – No More Batteries Powered by indoor/outdoor light and a USB‑C fast‑charge port, this remote eliminates disposable batteries. Over the next decade, it helps save up to 200 million batteries from landfills – a sustainable choice for your Samsung TV.
  • 2. Universal Replacement for Most Samsung TVs (2025–2026) Compatible with 20+ original models including BN59‑01480A, TM2560EN, TM2360, BN59‑01432A, BN59‑01385A, BN59‑01391A, BN59‑01357A, BN59‑01358F, BN59‑01259E, BN59‑01312B/H/G, BN59‑01312F, BN59‑01312A, BN59‑01312M, BN59‑01199F, BN59‑01259B, BN59‑01260A, BN59‑01266A, BN59‑01241A, BN59‑01301A, and more.
  • 3. One Remote, All Devices – Simplify Your Setup Replace multiple remotes with this single universal controller. Works seamlessly with your Samsung TV and connected devices (game consoles, soundbars) – no more juggling or pairing hassles.
  • 4. Voice Control & AI Shortcuts – 40‑Ft Range Advanced Bluetooth voice control works from up to 40 feet away. Press the dedicated AI button for smart search and screenshot functions. Dedicated shortcut keys launch Netflix, Prime Video, YouTube, and the web browser instantly.
  • 5. Durable, Long‑Lasting & Easy Bluetooth Pairing Built with sturdy ABS plastic and buttons tested for 100,000+ clicks. Pair quickly: hold Return + Play/Pause for 3+ seconds to activate Bluetooth – stable connection every time.
Rank #4
Sale
New BN59-01480A TM2360E Remote Control for Samsung TV, Smart AI Voice Control, Solar-Powered & USB-C Dual Charging, Compatible with Samsung Neo QLED/OLED Smart TVs (2021-2026 Models)
  • Wide Compatibility: BN59-01480A remote control is specifically designed for Samsung Smart TVs and is compatible with most Samsung Neo QLED, QLED, and OLED TV models released between 2021 and 2026.
  • Eco-Friendly Dual Charging: The BN59-01480A remote control achieves sustainable charging via built-in solar panels that can charge under indoor lighting conditions. Additionally, it features a USB-C port for rapid emergency charging, eliminating the need for disposable batteries and the hassle of frequent replacements.replacements.
  • Smart Voice Control: BN59-01480A supports AI voice commands for greater convenience. Simply press the voice button to control your TV, search for content, adjust volume, or launch apps.. Its dedicated AI button facilitates intelligent search and screenshot functionality.
  • One-Touch Streaming Access: The BN59-01480A remote control features four dedicated shortcut buttons. Access popular entertainment content instantly via these exclusive shortcut keys. Eliminate complex menu navigation for a smoother, more efficient viewing experience.
  • Effortless Pairing & Reliable Quality: The BN59-01480A remote control supports simple Bluetooth pairing (press and hold the Back button + Pause button for 3-5 seconds). We focus on enhancing durability through an upgraded design and offer a two-year warranty. Should you encounter any issues during use, please do not hesitate to contact our customer service team – we are always here to assist you!
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each 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. Its MCP server offers screenshot and page-information tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

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

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.