Corrected JavaScript lambda in python sections (#6692)

This commit is contained in:
Alexey Lagunov 2021-05-21 19:15:21 +03:00 committed by GitHub
parent 544ca37c00
commit 72c6f4f69e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,7 +56,7 @@ msg.args().get(1).jsonValue() // 42
```python async
# Listen for all console logs
page.on("console", msg => print(msg.text))
page.on("console", lambda msg: print(msg.text))
# Listen for all console events and handle errors
page.on("console", lambda msg: print(f"error: {msg.text}") if msg.type == "error" else None)
@ -74,7 +74,7 @@ await msg.args[1].json_value() # 42
```python sync
# Listen for all console logs
page.on("console", msg => print(msg.text))
page.on("console", lambda msg: print(msg.text))
# Listen for all console events and handle errors
page.on("console", lambda msg: print(f"error: {msg.text}") if msg.type == "error" else None)
@ -254,4 +254,4 @@ var popup = await page.RunAndWaitForEventAsync(PageEvent.Popup, async () =>
- [Page]
- [`event: Page.requestFailed`]
- [`event: Page.dialog`]
- [`event: Page.popup`]
- [`event: Page.popup`]