Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
Need to fetch text of a span class inside iframe in playwright javascript

Image of HTML structure

Can someone explain me how to get the text of the start game button which is present inside iFrame in Playwright JavaScript ,

I tried using below code but that is not working for me

        console.log(frame)
        // const text= await frame.locator("//div[text()='Start Game']").textContent();
        // console.log(text);```
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use frameLocator function to access the content within iFrame.

const btnStart = page.frameLocator('#external-app').locator('text=Start Game');
await btnStart.click();

More details: https://playwright.dev/docs/api/class-framelocator

To access the value or text, you can use page.innerText() or page.inputValue().

More infos here: https://playwright.dev/docs/api/class-page#page-input-value

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda