无法通过selenium python单击表中的超链接

时间:2015-11-02 12:53:24

标签: python-2.7 selenium webdriver

我正在尝试使用selenium webdriver python自动化一些东西。我在这方面取得了部分成功。我在两者之间取得了成功。

JavaMail

我正在尝试单击表描述符内的超链接,但它显示了一些错误。

这是我的代码:

<td role="gridcell" style="" title="6563378117093014222" aria-describedby="devices_x1AccountId">
  <a href="accountSummary?accountId=6563378117093014222">6563378117093014222</a>
</td>

我不知道我做错了什么。请提出一些解决方案

1 个答案:

答案 0 :(得分:2)

使用find_element代替find_elements

然后在您的xpath中搜索&#34; devices_billingId&#34;但是在你的代码中,aria-describedby是&#34; devices_x1AccountId&#34;

deviceID = browser.find_element_by_xpath("//*[@aria-describedby= 'devices_x1AccountId']/a")
deviceID.click()
相关问题