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

230
Views
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 answers
Answer question

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 Report
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!