Hey, I would like to insert some data into a JS prompt like this one. Is that possible with puppeteer?
Thanks 馃槑
There's a snippet in the API: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-dialog
const puppeteer = require('puppeteer');
puppeteer.launch().then(async browser => {
const page = await browser.newPage();
page.on('dialog', async dialog => {
console.log(dialog.message());
await dialog.dismiss();
browser.close();
});
page.evaluate(() => alert('1'));
});
@aslushnikov Thank you so much 馃槈
Most helpful comment
There's a snippet in the API: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-dialog