Hello World Master

Tutorials, articles and quizzes on Software Development

Code
Get a DOM element using Puppeteer > app > evaluateFunction.js
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');

  const getPtag = await page.$eval('p', (pTag => pTag.innerHTML));
  console.log(getPtag);

  await browser.close();
})();