1、正常的链接是可以识别的,无论多少级,我的就是,如果是在不行,你可以试下如下代码:
function menuSelect(menuName)
Set curPage=Browser("creationtime:=0").Page("index:=0")
menu=split(menuName,"-")
curPage.WebElement("innerhtml:="&menu(0)).Click
if curPage.WebButton("name:=确 定").exist(2) then
curPage.WebButton("name:=确 定").Click
end if
'依次把每级菜单找出来,
For i= 1 to UBound(menu)
Set menuDesc = description.Create()
menuDesc("text").Value=menu(i)
menuDesc("micclass").Value = "Link"
if curPage.Exist(1) then
label = 0
While(label = 0)
Set menuLists = curPage.ChildObjects(menuDesc)
NumberOfLists = menuLists.Count()
If NumberOfLists=1 Then
menu(i)=menuLists.Item(0).GetROProperty("html id")
label = label + 1
elseif NumberOfLists>1 then
For j=0 to NumberOfLists
tempCode=menuLists.Item(j).GetROProperty("html id")
If instr(tempCode,menu(i-1))>0 Then
menu(i)=tempCode
label = label + 1
Exit For
End If
Next
End If
Wend
curPage.Link("html id:="&menu(i)).Click
end if
Set menuLists = nothing
Set menuDesc = nothing
Next
Set curPage = nothing
End function