Sub 下载XML数据()
Dim http As Object, nod, nod2
'Set http = CreateObject("Microsoft.XMLHTTP")'拒绝访问
Set http = CreateObject("MSXML2.ServerXMLHTTP")
http.Open "get", "http://zx.500wan.com/static/info/kaijiang/xml/ssq/12019.xml", False
http.Send
i = 0
For Each nod In http.responseXML.getElementsByTagName("xml")
For Each nod2 In nod.ChildNodes
i = i + 1
Cells(i, 1) = nod2.nodeName
Cells(i, 2) = nod2.Text
Next
Next
a = Array("RedFX", "BlueFX", "TiDian")
For p = 0 To 2
i = Range("a65536").End(xlUp).Row
For Each nod In http.responseXML.getElementsByTagName(a(p))
For Each nod2 In nod.Attributes
i = i + 1
Cells(i, 1) = nod2.Name
Cells(i, 2) = nod2.Text
Next
Next
Next p
End Sub