Excel VBA数据已重新开始

时间:2017-09-15 08:24:34

标签: excel vba

我试图从网站中提取数据,但除非点击“加载所有事件”,否则大多数数据都会被隐藏。检查了加载所有事件链接,它是一个数据重新连接链接。知道如何使用Excel VBA扩展表格吗?链接网站为https://online.singaporepools.com/sportsbook/en/home。谢谢。这是我到目前为止所尝试的,但只捕获了显示的数据。

Sub DataMining()

Dim ie As Object

   Sheets("Sheet1").Select
   Range("A2:AZ3000").Clear


   Set ie = CreateObject("InternetExplorer.Application")
   With ie
    .Visible = True
    .Navigate "https://online.singaporepools.com/sportsbook/en/home"

     Do Until .ReadyState = 4: DoEvents: Loop


       ie.document.getElementsByclassname ("table-condensed")

        x = .document.body.innertext
        x = Replace(x, Chr(10), Chr(13))
        x = Split(x, Chr(13))
        Application.Wait (Now + TimeValue("00:00:03"))

        Sheet1.Cells(1, 1).Resize(UBound(x)) = Application.Transpose(x)



     .Quit
    End With

End Sub

Snapshot

0 个答案:

没有答案