Horje
get element text puppeteer Code Example
get element text puppeteer
 const puppeteer = require('puppeteer');

describe('My First Puppeteer Test', () => {
    it('should launch the browser', async function() {
        const browser = await puppeteer.launch({
             headless: false,
             slowMo: 50, 
             devtools: false,
        });
        const page = await browser.newPage();
        await page.goto('http://example.com/');
        const title = await page.title();
        const url = await page.url();
        const text = await page.$eval('h1', element => element.textContent)
        console.log('Text in the H1: ' + text);
        await browser.close();
    })
})




Javascript

Related
validate email javascript Code Example validate email javascript Code Example
how to clamp a value by modulus Code Example how to clamp a value by modulus Code Example
Elements in iteration expect to have 'v-bind:key' directives Code Example Elements in iteration expect to have 'v-bind:key' directives Code Example
vue js Elements in iteration expect to have 'v-bind:key' directives Code Example vue js Elements in iteration expect to have 'v-bind:key' directives Code Example
navigate to url javascript Code Example navigate to url javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8