Click a button within an iframe - pyppeteer

1.2k Views Asked by At

I am trying to click a button inside an iframe using pyppeteer - the python version of puppeteer However, I have drawn a blank. A simple page.click('#selector') does not seem to draw results and await page.waitForSelector('#selector') does not pick it up either

Could anyone advise? The buttons prior to the iframe work fine Thanks

1

There are 1 best solutions below

0
On

You need to switch the context to iframe.

There's an example in other thread: Trying to click a button within an iframe with puppeteer

And there's a solution from pptr docs (probably they're similar to python): https://pptr.dev/#?product=Puppeteer&version=v9.0.0&show=api-class-frame