如何从Python中单击一个按钮

Har*_*arg 0 python selenium

请帮助我,因为我对Python Selenium很新.我正在使用Anaconda2,Jupiter和Chrome浏览器.

我正在写下成功运行的代码,但现在我想点击按钮.

<a href="#" action="exportSelected" class="btn btn-default">
    <i class="glyphicon glyphicon-download"></i> Export
</a>
Run Code Online (Sandbox Code Playgroud)

我应该用Python写什么来访问它?请帮忙.驱动程序.

find_element_by_partial_link_text('btn btn-default').click()
Run Code Online (Sandbox Code Playgroud)

它给出了一个错误.

请建议...感谢您的宝贵时间!

哈里什库马尔

And*_*son 5

"btn btn-default"不是链接文本,而是类名.

您可以使用以下解决方案之一: