Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Trying to access iframe inside of another iframe with puppeteer

I am trying to access iframe inside of another iframe with puppeteer. It just happened so the website itself is in iframe, and then there is login form in another iframe.

I have tried to access the nested iframe by first accessing not nested one, but apparently it doesn't work, because it doesn't detect any elements.

The first iframe and interaction with it, work perfectly fine.

Thanks in advance y'all.

That's visual representation of nested iframe, if you didn't get what I mean.

const puppeteer = require("puppeteer");

(async () => {
    const browser = await puppeteer.launch({ headless: false });
    const page = await browser.newPage();
    await page.goto('https://www.hentaiheroes.com');

    await page.waitForTimeout(1000);

    // Confirm the age by clicking button 'OK'
    await page.waitForSelector('iframe');
    const element = await page.$(
      'iframe[src="/home.html"]',
    );
    const frame = await element.contentFrame();
    await frame.click('#popup_confirm');

    // Click on login button
    await frame.waitForSelector('.igreen');
    await frame.click('.igreen');
    
    // Login with credentials
    await frame.waitForSelector('#authentication-iframe');
    const innerElement = await frame.$(
      'iframe[src="https://eggs-ext.kinkoid.com/authentication/start_authentication?product_id=1&language=en&purpose=authenticate"]',
    );
    const innerFrame = await innerElement.contentFrame();
    console.log("1");
    await innerFrame.waitForSelector('#login_register_form');
    console.log("2");
    // await innerFrame.type('#auth-email', 'abzh423@protonmail.com');
    // await page.waitForSelector('#auth-password');
    // await loginFrame.type('#auth-password', 'Ab77015221787');
    // await loginFrame.click('#submit-authenticate');

    // await browser.close();
})();

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!