结果从网站提取



我试图从类似表中提取结果:

https://data.fei.org/result/result/resultlist.aspx?p=d6E828828E450E450E2880525ABCEE800008C1D381967CBAF718D9DE41BEBA3B9B9B9B9B9B9B9F06

我已应用遵循代码,但似乎不起作用。关于应该使用哪些表元素的任何想法?:

Sub Macro1()
Dim IE As New InternetExplorer
Dim CompetitionLink As String
CompetitionLink = ThisWorkbook.Worksheets("Settings").Range("B2")
IE.Navigate CompetitionLink
IE.Visible = True
Rank = IE.Document.getElementsByTagName("grid sc")(0).Rows(1).Cells(2).innerText
Debug.Print Rank
End Sub

尝试该代码

    Sub Test()
        Dim ie              As New InternetExplorer
        Dim competitionLink As String
        Dim rank            As String
        competitionLink = ThisWorkbook.Worksheets("Settings").Range("B2")
        With ie
            .Visible = True
            .navigate competitionLink
            Do: DoEvents: Loop Until .readyState = 4
            rank = .document.getElementsByClassName("grid sc")(0).Rows(1).Cells(2).innerText
            Debug.Print rank
        End With
    End Sub

**您也可以获取所有表数据..请查看此链接刮擦HTML表

相关内容

  • 没有找到相关文章

最新更新