2011-12-09 77 views
0
<td class="button" nowrap align="center"> 
    <a href="#" onKeyPress="javascript:checkkey(event);" onMouseDown="javascript:funclogin();"> 
     Login 
    </a> 
</td> 

如何在python中使用硒单击此按钮?如何点击给定的链接?

+0

可能重复[使用xpath来告诉硒在哪里点击?](http://stackoverflow.com/questions/3406103/using-xpath-to-tell-selenium-where-to-click) – Li0liQ

+0

你能否详细说明更多关于这个 –

回答

0

如何使用标签的类?

driver.find_elements_by_xpath("//td[@class='button']/a").click() 

无论如何,您可能希望在代码中添加更好的标识符以使其更健壮。