puppeteer event element change

Solutions on MaxInterview for puppeteer event element change by the best coders in the world

showing results for - "puppeteer event element change"
Mariana
09 May 2016
1const puppeteer = require('puppeteer');
2
3(async() => {
4  const browser = await puppeteer.launch();
5  const page = await browser.newPage();
6  await page.exposeFunction('onCustomEvent', text => console.log(text));
7  await page.goto('https://www.time.ir', {waitUntil: 'networkidle0'});
8  await page.evaluate(() => {
9    $('#digitalClock').bind("DOMSubtreeModified", function(e) {
10      window.onCustomEvent(e.currentTarget.textContent.trim());
11    });
12  });
13})();