◐ Shell
clean mode source ↗

CDPSession | Playwright Python

client = page.context.new_cdp_session(page)

client.send("Animation.enable")

client.on("Animation.animationCreated", lambda: print("animation created!"))

response = client.send("Animation.getPlaybackRate")

print("playback rate is " + str(response["playbackRate"]))

client.send("Animation.setPlaybackRate", {

"playbackRate": response["playbackRate"] / 2

})