/puppeteer-get-iframe

simple library for obtaining iframe with puppeteer

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

logo

version env language

A simple library for obtaining iframe with puppeteer

install

  • 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;

how to use

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();
})();