我试图单击一个弹出按钮,代码显示错误:
"selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable".
我已经搜索,但找不到解决方案,我与弹出按钮。在
Image for clicking show 10 rows and displaying the pop-up box所附图像是所需的结果,“Show 10 rows”位于其后面,并且很容易看到。在
我有这个在我的HTML代码,需要点击按钮。在
<div class="table-responsive">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" id="loadsur" href="#Section" aria-expanded="true">LoadSurvey</a></li>
</ul>
<div class="container-fluid">
<div class="row">
<div class="col-md-12" style="margin-left: -10px;">
<div class="table-responsive">
<div id="myDataTable25_wrapper" class="dataTables_wrapper no-footer"><div class="dt-buttons">
<button class="dt-button buttons-csv buttons-html5" tabindex="0" aria-controls="myDataTable25">
<span>Csv</span></button>
<button class="dt-button buttons-excel buttons-html5" tabindex="0" aria-controls="myDataTable25">
<span>Excel</span></button>
<button class="dt-button buttons-collection buttons-page-length" tabindex="0" aria-controls="myDataTable25" aria-haspopup="true">
<span>Show 10 rows</span></button>
</div>
</div>
</div>
</div>
</div>
在Python中,我尝试了以下方法:
^{pr2}$我希望单击这个按钮,这会导致弹出按钮出现。在
它可能在
iframe
中。在首先尝试找到iframe并切换到它。在
然后尝试单击按钮。在
^{pr2}$将
xpath
更改为:尝试使用
WebDriverWait
确保元素存在,并添加expected_conditions
直到元素clickable
。在导入此:
^{pr2}$试试这个:
或使用
ActionChains
,导入:试试这个:
我找到了解决这个问题的办法。xpath中的链接出错。我后来从html中复制并粘贴,现在代码如下:
而且效果很好。谢谢大家的帮助。在
相关问题 更多 >
编程相关推荐