diff --git a/docs/api.md b/docs/api.md index 295d0c2c01c..5529d1491f1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -806,7 +806,7 @@ const crypto = require('crypto'); puppeteer.launch().then(async browser => { const page = await browser.newPage(); - page.on('console', msg => console.log(msg.text)); + page.on('console', msg => console.log(msg.text())); await page.exposeFunction('md5', text => crypto.createHash('md5').update(text).digest('hex') ); @@ -828,7 +828,7 @@ const fs = require('fs'); puppeteer.launch().then(async browser => { const page = await browser.newPage(); - page.on('console', msg => console.log(msg.text)); + page.on('console', msg => console.log(msg.text())); await page.exposeFunction('readfile', async filePath => { return new Promise((resolve, reject) => { fs.readFile(filePath, 'utf8', (err, text) => {