【发布时间】:2020-03-21 17:49:32
【问题描述】:
我的网页包含多个<frame>。我需要找到包含//a[@id='edit'] 的框架。
所以我尝试了//frame[//a[@id='edit']],但是这个 xpath 返回 0 元素。
<frame>
...
</frame>
<frame>
#document
<html>
<head></head>
<body>
...
<a id='edit'>Edit</a> <!-- Added closing tag -->
...
</body>
</html>
</frame>
<frame>
...
</frame>
有什么想法吗?
【问题讨论】:
-
要完成zx485的回答,添加一个“。”到请求应该足够了
//frame[.//a[@id='edit']].
标签: selenium selenium-webdriver xpath iframe webdriver