在VBA中使用XMLHTTP从多个页面parsing/刮取

下面的代码只抓取/parsing一页数据(50结果)到Excel中,但是,我想它刮了多个页面(500结果) – 请帮助。 (Base64Encode是从另一个来源采取的 – 我不赞赏它)

`Function GetData() As Boolean Application.ScreenUpdating = False Dim objHTTP As New MSXML2.XMLHTTP Dim strURL As String Dim strUserName As String Dim strPassword As String Sheet1.Range("A2:R2000") = "" Sheet1.Activate strUserName = "User" strPassword = "Password" For i = 1 To UBound(MyArray) strURL = "https://.ngx.com/ngxcs/indexPrice.xml" objHTTP.Open "GET", strURL, False objHTTP.setRequestHeader "Authorization", "Basic " & Base64Encode(strUserName & ":" & strPassword) objHTTP.setRequestHeader "Host", "secure.example.com" objHTTP.setRequestHeader "Content-Type", "text" objHTTP.send "Nothing" While objHTTP.readyState <> 4 DoEvents Wend Dim strResponseReceived As String strResponseReceived = objHTTP.responseText Debug.Print objHTTP.responseText MsgBox strResponseReceived Dim xDoc As DOMDocument Set xDoc = New DOMDocument xDoc.LoadXML objHTTP.responseText` 

输出到Excel中的代码剩余部分

谢谢您的帮助!