0

我有一个 webtable 并且有很多动态链接。我需要点击一个我已经从 weblist 中选择的特定链接。我尝试了一些代码,但它们不起作用,请给我一些有价值的解决方案。

Scheme = DataTable.Value("Scheme", "dtDataSheet")

If checkIfItemExistInWeblist(sScheme, Browser("ViewPortfolio").Page("AddTransaction").WebList("schemeId") Then
    Browser("View Portfolio").Page("Add Transaction").WebList("schemeId").Select sScheme
    Wait(5)
    sSchemeName = sScheme
End If

goToSchemePage(sSchemeName)

Function goToSchemePage(sSchemeName)    
    Dim oAnchor
    Dim blnFound
    Set oAnchors = Browser("AssetDetails").Page("AssetDetails").WebElement("SchemeLastNAVUnits/Avg.").Object.GetElementsByTagName("A") 

    blnFound = False
    For Each oAnchor in oAnchors
        If oAnchor.innertext = sSchemeName Then
            oAnchor.Click()
            blnFound = True
        End If
        Set oAnchor = Nothing

        If blnFound = True Then Exit For
    Next 'oAnchor

    Set oAnchors = Nothing
End Function

但它不起作用,请向我提供您有价值的解决方案。

4

0 回答 0