Skip to content

Commit af92565

Browse files
authored
Update class-page example code (#6379)
1 parent 07fb81a commit af92565

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/api/class-page.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ The arguments passed into `console.log` appear as arguments on the event handler
137137
An example of handling `console` event:
138138

139139
```js
140-
page.on('console', msg => {
140+
page.on('console', async msg => {
141141
for (let i = 0; i < msg.args().length; ++i)
142142
console.log(`${i}: ${await msg.args()[i].jsonValue()}`);
143143
});
144-
page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
144+
await page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
145145
```
146146

147147
```java

0 commit comments

Comments
 (0)