我试图在Python中使用Selenium单击以下按钮。然而,我试图点击那个按钮的任何方法都失败了,我希望有人能帮助我。出于所有意图和目的。我是Python/Selenium的新手,因此非常感谢您的帮助
<tr>
<td colspan=3></td>
<td align=center valign='center'> <a href="javascript:myFunction('/mailbox/jsp/MBIList.jsp')"
onMouseOver="chgButton('Go','GoOver'); window.status=''; return true;"
onMouseOut="chgButton('Go','GoOff'); window.status=''; return true;"
onMouseDown="chgButton('Go','GoDown'); return true;"><img border=0
src="/mailbox/images/go_off.gif" vspace=7 name='Go' align='top'></a>
</td>
</tr>
您可以使用任何元素属性单击任何元素。例如,在本例中,我将在Xpath中使用属性@name='Go',您将在其中尝试选择元素
所需的元素是一个动态元素,因此要单击该元素,必须为
element_to_be_clickable()
归纳WebDriverWait,并且可以使用以下Locator Strategies之一:使用
CSS_SELECTOR
:使用
XPATH
:注意:您必须添加以下导入:
相关问题 更多 >
编程相关推荐