我正在尝试使用 Python 和 Playwright 在 iframe 中选择一个按钮...在 Selenium 中我知道你可以通过使用索引来做到这一点,这在 playwright 中是否可能,我一直在挖掘文档,但似乎无法弄清楚出来。我尝试选择的 iframe 中包含的按钮是:
"button:has-text(\"Add New User\")"
Run Code Online (Sandbox Code Playgroud)
我正在使用的 iframe 的 html 代码类似于以下内容:
<iframe src="https://www.urlthatcannotbereturnedinpagehtml.com/veryparticularparameters" width="100%" style="height: 590px;"></iframe>
Run Code Online (Sandbox Code Playgroud)
有人有想法吗?关于这里束手无策......我试图通过解析网页的代码来找到url,但是这部分不能像那样选择。我可能只是对剧作家的文档感到不知所措,我在硒上花了很多时间,这似乎是一种全新的语言。
谢谢!