Answers for "puppeteer event element change"

0

puppeteer event element change

const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.exposeFunction('onCustomEvent', text => console.log(text));
  await page.goto('https://www.time.ir', {waitUntil: 'networkidle0'});
  await page.evaluate(() => {
    $('#digitalClock').bind("DOMSubtreeModified", function(e) {
      window.onCustomEvent(e.currentTarget.textContent.trim());
    });
  });
})();
Posted by: Guest on July-05-2020

Code answers related to "puppeteer event element change"

Code answers related to "Javascript"

Browse Popular Code Answers by Language