Corrected JavaScript lambda in python sections (#6692)
This commit is contained in:
parent
544ca37c00
commit
72c6f4f69e
|
|
@ -56,7 +56,7 @@ msg.args().get(1).jsonValue() // 42
|
||||||
|
|
||||||
```python async
|
```python async
|
||||||
# Listen for all console logs
|
# 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
|
# Listen for all console events and handle errors
|
||||||
page.on("console", lambda msg: print(f"error: {msg.text}") if msg.type == "error" else None)
|
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
|
```python sync
|
||||||
# Listen for all console logs
|
# 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
|
# Listen for all console events and handle errors
|
||||||
page.on("console", lambda msg: print(f"error: {msg.text}") if msg.type == "error" else None)
|
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]
|
- [Page]
|
||||||
- [`event: Page.requestFailed`]
|
- [`event: Page.requestFailed`]
|
||||||
- [`event: Page.dialog`]
|
- [`event: Page.dialog`]
|
||||||
- [`event: Page.popup`]
|
- [`event: Page.popup`]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue