Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get element by id in node js

const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch();


        page = await browser.newPage();
        await page.goto('http://example.com/some.html', {waitUntil: 'load'});


    const newPage = await page.evaluate(() => {

        return  document.getElementById("idexample").innerHTML;

        });

     console.log(newPage)

  })();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #element #id #node #js
ADD COMMENT
Topic
Name
9+9 =