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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To capture an inline SVG without its SMIL animation moving during a Playwright screenshot, pause each SVG root in the page, then take the screenshot with animations: 'disabled'. The two steps cover different animation mechanisms: Playwright’s option handles CSS animations, CSS transitions, and Web Animations; the SVG call freezes the SVG document fragment’s animation clock at its current position.

Pause inline SVG animation before capturing

In JavaScript, run pauseAnimations() for SVG roots in the page context, then take the screenshot. Keep animations: 'disabled' in the screenshot call to handle CSS and Web Animations on the page as well.

await page.evaluate(() => {
  document.querySelectorAll('svg').forEach(svg => svg.pauseAnimations());
});
await page.screenshot({ path: 'page.png', animations: 'disabled' });

This targets SVG elements present in the page DOM. If you need a particular frame rather than whichever frame happens to be current, first arrange the animation state deliberately, then pause it. Pausing alone freezes the current time; it does not select a canonical frame.

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

Python async

The same page-side pause works with Playwright’s Python async API:

#1 Best Overall
Samsung 14" Galaxy Chromebook Go Laptop PC Computer, Intel Celeron N4500 Processor, 4GB RAM, 64GB Storage, ChromeOS, XE340XDA-KA2US, Student Laptop, Silver
  • SLIM. LIGHTWEIGHT. READY TO GO: The all-new slim design is perfect for busy lives on the go.
  • SKILLFULLY DESIGNED. MILITARY TOUGH: Built with premium craftsmanship to withstand the occasional drop or ding.
  • ALL-DAY, ALL-IN-ONE CHARGING: Power through your school day – and beyond – with a long-lasting 12-hour battery.¹
  • 3X FASTER THAN THE PREVIOUS GENERATION OF WIFI: Crush your schoolwork in record time with Wi-Fi that’s three times faster than the previous generation of Wi-Fi.
  • YOUR PHONE AND CHROMEBOOK WORK BETTER TOGETHER: Easily transfer files between devices, and control your phone right from your Chromebook.
await page.evaluate("""() => {
  document.querySelectorAll('svg').forEach(svg => svg.pauseAnimations());
}""")
await page.screenshot(path="page.png", animations="disabled")

Capturing a locator

Pause the SVG roots through the page before taking the locator screenshot. Use the equivalent screenshot option on the locator:

await page.evaluate(() => {
  document.querySelectorAll('svg').forEach(svg => svg.pauseAnimations());
});
await page.getByTestId('target').screenshot({ path: 'element.png', animations: 'disabled' });

In Python, locator screenshots also accept animations="disabled". The locator controls what is captured; the page evaluation is still needed to pause inline SVG roots.

Rank #2
HP Chromebook 14 Laptop, Intel Celeron N4120, 4 GB RAM, 64 GB eMMC, 14" HD Display, Chrome OS, Thin Design, 4K Graphics, Long Battery Life, Ash Gray Keyboard (14a-na0226nr, 2022, Mineral Silver)
  • FOR HOME, WORK, & SCHOOL – With an Intel processor, 14-inch display, custom-tuned stereo speakers, and long battery life, this Chromebook laptop lets you knock out any assignment or binge-watch your favorite shows..Voltage:5.0 volts
  • HD DISPLAY, PORTABLE DESIGN – See every bit of detail on this micro-edge, anti-glare, 14-inch HD (1366 x 768) display (1); easily take this thin and lightweight laptop PC from room to room, on trips, or in a backpack.
  • ALL-DAY PERFORMANCE – Reliably tackle all your assignments at once with the quad-core, Intel Celeron N4120—the perfect processor for performance, power consumption, and value (2).
  • 4K READY – Smoothly stream 4K content and play your favorite next-gen games with Intel UHD Graphics 600 (3) (4).
  • MEMORY AND STORAGE – Enjoy a boost to your system’s performance with 4 GB of RAM while saving more of your favorite memories with 64 GB of reliable flash-based eMMC storage (5).

What the two animation controls do

Control Animation types and scope Frame behavior
animations: 'disabled' on a Playwright screenshot CSS animations, CSS transitions, and Web Animations, as documented by Playwright’s page screenshot API. Finite animations are fast-forwarded to completion, firing transitionend. Infinite animations are canceled to their initial state before being played again after the screenshot. This is not a universal pause-at-current-frame setting.
svg.pauseAnimations() on an SVG root The SVG document fragment’s animation clock, including applicable SVG declarative animation. Stops the clock at its current position, according to MDN’s SVGSVGElement reference. It does not choose a specific time or frame.

Playwright documents allow as the default for page screenshots, and the Python locator screenshot API also documents allow as its default. When deterministic output matters, make the intended controls explicit rather than relying on defaults.

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

Distinguish SVG SMIL from other animation patterns

SVG declarative animation includes SMIL elements such as <animate>, <animateMotion>, and <animateTransform>. These are distinct from CSS animation and transitions. An SVG can also be moved or redrawn by JavaScript, which may need an application-specific way to stop updates; neither screenshot option is established as a universal switch for every script-driven pattern.

A Playwright issue opened on June 21, 2024 reported inline SVG SMIL continuing during a locator screenshot with animations: 'disabled' in Playwright 1.41.1. That report supports adding the explicit SVG pause when SMIL is present, but it does not establish behavior for every later Playwright release or browser engine. Verify your own version and target browser when the result is important.

Limits and reproducibility checks

  • External SVGs: The loop selects SVG elements in the page DOM. It does not demonstrate control of an SVG loaded as an external image resource.
  • Choose the target state: Since pauseAnimations() freezes the current SVG time, stabilize the app and arrange the desired frame before pausing.
  • Script-driven motion: If JavaScript keeps changing the SVG after the pause, use the page’s own controls or test hooks to stop that code before capture.
  • Confirm the output: Check the resulting screenshot in the relevant browser and Playwright version; the cited 1.41.1 report is a specific reproduction, not a release-by-release compatibility guarantee.
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 screenshot API and MCP server, but it does not document a control for pausing SVG animation clocks. If you need a particular SVG frame, use the Playwright approach above and verify the captured state. For ordinary page captures where you do not need to control an animation frame, a one-request screenshot looks like this; see the ScreenshotNeo API documentation for request options.

Rank #4
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
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; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

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.