Thanks for watching, I have a list with urls in D and E, I need to get the value in XML and print it after F.then wrap to the next line.
Sub main()
On Error Resume Next
hang1 = Sheet1.Cells(Rows.Count, "a").End(xlUp).Row
If hang1 < 2 Then Exit Sub
sz_yuan = Sheet1.Range("D2:E" & hang1)
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.SetProperty "SelectionLanguage", "XPath"
xmlDoc.async = False
With CreateObject("MSXML2.XMLHTTP")
Set nodeXML = xmlDoc.getElementsByTagName("Business_Item_Desc")
For a = 1 To hang1 - 1
For b = 1 To 2
Application.StatusBar = "capture" & a & "/" & hang1 - 1 & "Article of data" & b & "/2..."
DoEvents
URL0 = sz_yuan(a, b)
.Open "GET", URL0, True
.send
Do While .ReadyState <> 4
DoEvents
Loop
jg0 = .responseText
If InStr(jg0, "<data/>") = 0 Then
For i = 0 To nodeXML.Length - 1
Sheet1.Range("F").Offset(0, i).Value = nodeXML.Item(i).Text
Next i
Exit For
End If
dqhang = Sheet1.Cells(Rows.Count, "a").End(xlUp).Row
Next b
Next a
End With
Application.StatusBar = ""
End Sub
Among them, there is an error when the array is printed, and I want to ask how to modify it to run normally.
For i = 0 To nodeXML.Length - 1
Sheet1.Range("F").Offset(0, i).Value = nodeXML.Item(i).Text
Next i
