LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Answered

Why am I having trouble loading iFrames on my website while taking screenshots?

Can anyone please guide me on why am I having trouble loading iFrames on my website while taking screenshots.

Up Vote Down Vote 0 Votes
Posted 4 months ago

Answers


If you need to do the capture in a programmed way, you have the option of using nodejs with puppeteer which is a library that uses chromium to simulate a web browser. I give you an example to capture the screen:

const puppeteer = require('puppeteer');
async function run() {
    let browser = await puppeteer.launch({ headless: false });
    let page = await browser.newPage();
    await page.goto('https://www.scrapehero.com/');
    await page.screenshot({ path: './image.jpg', type: 'jpeg' });
    await page.close();
    await browser.close();
}
run();
Up Vote Down Vote 0 Votes
Posted 2 months ago
132 Views
1 Answer
4 months ago