From 550b48f9587fb172fa319217b5756b88b594d245 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Fri, 25 Jun 2021 11:53:55 -0700 Subject: [PATCH] docs: fix the python cdp snippet (#7324) --- docs/src/api/class-cdpsession.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/api/class-cdpsession.md b/docs/src/api/class-cdpsession.md index cb06d2607b..e29dd94c2a 100644 --- a/docs/src/api/class-cdpsession.md +++ b/docs/src/api/class-cdpsession.md @@ -25,23 +25,23 @@ await client.send('Animation.setPlaybackRate', { ```python async client = await page.context().new_cdp_session(page) -await client.send("animation.enable") -client.on("animation.animation_created", lambda: print("animation created!")) -response = await client.send("animation.get_playback_rate") -print("playback rate is " + response["playback_rate"]) -await client.send("animation.set_playback_rate", { - playback_rate: response["playback_rate"] / 2 +await client.send("Animation.enable") +client.on("Animation.animationCreated", lambda: print("animation created!")) +response = await client.send("Animation.getPlaybackRate") +print("playback rate is " + response["playbackRate"]) +await client.send("Animation.setPlaybackRatee", { + playback_rate: response["playbackRate"] / 2 }) ``` ```python sync client = page.context().new_cdp_session(page) -client.send("animation.enable") -client.on("animation.animation_created", lambda: print("animation created!")) -response = client.send("animation.get_playback_rate") -print("playback rate is " + response["playback_rate"]) -client.send("animation.set_playback_rate", { - playback_rate: response["playback_rate"] / 2 +client.send("Animation.enable") +client.on("Animation.animationCreated", lambda: print("animation created!")) +response = client.send("Animation.getPlaybackRate") +print("playback rate is " + response["playbackRate"]) +client.send("Animation.setPlaybackRate", { + playback_rate: response["playbackRate"] / 2 }) ```