[英]Click a button using selenium in Python
I have the below HTML code 我有以下HTML代码
<footer class="aui-dialog2-footer">
<div class="aui-dialog2-footer-actions">
<button class=" aui-button aui-button-primary dialog-submit" resolved="">
Add key
</button>
<button class=" aui-button aui-button-link dialog-cancel" resolved="">Cancel</button>
Here is the attached image 这是附件图像
I want to click this button using selenium. 我想使用硒单击此按钮。 I have written 我已经写了
driver.find_element_by_xpath("//button[contains(text(),'Add key')]").click()
But this is not clicking the button. 但这不是单击按钮。 I have used find_element_by_class_name but it shows it can't resolve class name. 我使用过find_element_by_class_name,但它显示它无法解析类名。 How can I click this button using selenium. 如何使用硒单击此按钮。
看起来像其他iFrame中的样子,如果是,只需切换到它即可
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.