docs(README): Update debugging tips (#1868)

This commit is contained in:
Artem Sapegin 2018-01-23 01:10:31 +01:00 committed by Andrey Lushnikov
parent cb684ebbc4
commit 797b561013

View File

@ -165,7 +165,7 @@ Explore the [API documentation](docs/api.md) and [examples](https://github.com/G
1. Capture console output - You can listen for the `console` event.
This is also handy when debugging code in `page.evaluate()`:
page.on('console', msg => console.log('PAGE LOG:', ...msg.args));
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
await page.evaluate(() => console.log(`url is ${location.href}`));