我试图数一数一页上有多少个按钮。然后再按一下。然而,要访问这些按钮,我必须经过一个iframe、一些通用(div)层和一个区域(section)层
我可以使用
driver.switch_to.frame("iframeID")
但是我不知道如何访问secion层中的元素
html如下所示:
<iframe id="iframeID" resize="" src="about:blank;" seamless="" scrolling="no" allowfullscreen="" style="height: 2135px;" xpath="1">
#document
<!document>
<html>
<head>...</head>
<body>
<section class="sectionC">
<div class="divC">
<button type="button" class="buttonC" data-id="1234" style="">Done</button>
</div>
</section>
</body>
</html>
</iframe>
用漂亮的汤很容易做到:
希望这有帮助
相关问题 更多 >
编程相关推荐