getElementsByClassName vba宏不返回任何值

时间:2016-10-04 03:48:24

标签: vba excel-vba getelementsbyclassname excel

我正在尝试获取项目“04/15/2017”(位于“调用日期”项目下),但宏不返回任何值。 谢谢

Sub getCallDate()
    Dim objIE As InternetExplorer
    Dim beta As Object
    Dim aEle As Object

    Set objIE = New InternetExplorer
    objIE.Visible = True
    objIE.navigate "http://finra-markets.morningstar.com/BondCenter/Default.jsp"
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
    objIE.document.getElementById("firscreener-cusip").Value = "683797AB0"
    Set beta = objIE.document.getElementsByClassName("button_blue").Item(1)
    beta.Click
    Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
    i = 3
    For Each aEle In objIE.document.getElementsByClassName("text1 str")
        Cells(i, 1) = aEle.textContent
        i = i + 1
    Next

End Sub

0 个答案:

没有答案