I am attempting to select a button within an iframe utilizing Python & Playwright... in Selenium I know you can do this by using indexes. Is this possible in playwright? I've been digging through the documentation and can't seem to figure it out. The button contained within the iframe that I am trying to select is:
"button:has-text(\"Add New User\")"
The html code for the iframe I am using looks similar to this:
<iframe src="https://www.urlthatcannotbereturnedinpagehtml.com/veryparticularparameters" width="100%" style="height: 590px;"></iframe>
Does anyone have any thoughts? I've attempted to find the URL by parsing the code for the webpage, but this portion can't be selected like that. I may just be at a loss with the documentation in Playwright, I've spent so much time in selenium that this seems like an entirely new language.
await
fromawait page.frameLocator('iFrame')
. The onlyawait
necessary is on the action taken on the locator,.click()
in this case. Technically, there's nothing wrong withawait
ing a locator, but it's a bit misleading and it's extra syntax that doesn't need to be there. Also, the question is tagged Python, so I'm not sure how this answers OP's question. – Ozzy