【发布时间】:2017-12-19 07:20:50
【问题描述】:
在网页中有 10 个具有相同名称的查看联系人选项卡(查看联系人)。我正在尝试使用 selenium VBA 单击每个查看联系人选项卡,但我只能使用下面的 Selenium VBA 代码单击第一个查看联系人但 Internet资源管理器代码工作正常,但我想使用 selenium vba 代码单击每个选项卡。
我的 Selenium VBA 代码:-
Dim ele As WebElement
For Each ele In driver.FindElementsByXPath("//input[@value='View Contact']")
ele.Click
Next
我的 Internet Explorer 代码:-
With ie.document
Set elems = .getElementsByTagName("input")
For Each e In elems
If (e.getAttribute("value") = "View Contact") Then
e.Click
'Exit For
End If
Next e
End With
我的 Html 代码:-所有 10 个选项卡都具有相同的 html 代码
<input type="button" class="boxOpener btn blue b" style="width: 150px;font-size: 14px;" value="View Contact">
【问题讨论】:
-
可以提供html吗?当您单击联系人选项卡时,页面会发生什么?