Update class-page example code (#6379)
This commit is contained in:
parent
07fb81a4ef
commit
af92565bc7
|
|
@ -137,11 +137,11 @@ The arguments passed into `console.log` appear as arguments on the event handler
|
||||||
An example of handling `console` event:
|
An example of handling `console` event:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
page.on('console', msg => {
|
page.on('console', async msg => {
|
||||||
for (let i = 0; i < msg.args().length; ++i)
|
for (let i = 0; i < msg.args().length; ++i)
|
||||||
console.log(`${i}: ${await msg.args()[i].jsonValue()}`);
|
console.log(`${i}: ${await msg.args()[i].jsonValue()}`);
|
||||||
});
|
});
|
||||||
page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
await page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
||||||
```
|
```
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue