I'm trying to capture information within a website but I'm having problems with the iframes.
I need to access the site https://www.saisp.br/online/produtos-publicos/, click on the left menu Paraíba do Sul Telemetric Network and capture the value of the line Rio Paraitinga - Passarela / São Luiz do Paraitinga.
My code below doesn't capture the information from the second iframe. How can I do this?
const puppeteer = require('puppeteer');
(async () => {
  // Launch a new browser instance
  const browser = await puppeteer.launch();
  // Create a new page instance
  const page = await browser.newPage();
  // Navigate to the specified webpage
  await page.goto('https://www.saisp.br/online/produtos-publicos/');
  await page.waitForTimeout(4000)
  const link = await page.$x('/html/body/app-home/div/nav/ul/li[12]/div/div[1]/a');
  await link[0].click();
  await page.waitForTimeout(2000)
  // Espera o iframe carregar e troca o contexto para ele
  // Selecione o iframe usando XPath
  const iframe = (await page.$x('/html/body/app-home/div/main/iframe'))[0];
  const frameContent = await iframe.contentFrame(); 
  await page.waitForTimeout(1000)
  await frameContent.waitForSelector('#tbTelemBody');
  const elemento = (await frameContent.$x('/html/body/div/table/tbody/tr/td[2]'))[0];
  const value = await frameContent.evaluate(el => el.textContent, elemento);
  console.log(value);
  await browser.close();
})();
 
    