- NOTE: for use this project, you need last version on puppeteer.
install this project with npm:
~# npm install puppeteer-get-iframe --save
now, import this on your project
const puppeteer = require('puppeteer')
const iframe = require('puppeteer-get-iframe').iframeAttached;
for get iframe from your project, you need pass page
param and a name or id of iframe
you want to get.
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
var frame = await iframe(page, 'IFRAME_ID_OR_NAME');
console.log(frame)
await browser.close();
})();