Galactico
10-10-2017, 08:21 PM
I'm trying to create a macro to get web data, without success
on the page there are 4 sentences of "stylePrice", I want to obtain them independently (especially with the values (0), (1), (2) and (3)), that's why I want stylePice to be the filter
I would greatly appreciate your help, sorry for my english, not main language.
Sub TESTCK()Dim htmlDeRespuesta As Object
Set htmlDeRespuesta = CreateObject("htmlFile")
With CreateObject("msxml2.xmlhttp")
.Open "Get", "https://www.cardkingdom.com/mtg/ixalan/carnage-tyrant", False
.send
htmlDeRespuesta.body.innerhtml = .responsetext
End With
On Error Resume Next
Range("c4").Value = htmlDeRespuesta.getElementsById("stylePrice").getElementsByTagName("span")(0).innertext
On Error GoTo 0
End Sub
20627
on the page there are 4 sentences of "stylePrice", I want to obtain them independently (especially with the values (0), (1), (2) and (3)), that's why I want stylePice to be the filter
I would greatly appreciate your help, sorry for my english, not main language.
Sub TESTCK()Dim htmlDeRespuesta As Object
Set htmlDeRespuesta = CreateObject("htmlFile")
With CreateObject("msxml2.xmlhttp")
.Open "Get", "https://www.cardkingdom.com/mtg/ixalan/carnage-tyrant", False
.send
htmlDeRespuesta.body.innerhtml = .responsetext
End With
On Error Resume Next
Range("c4").Value = htmlDeRespuesta.getElementsById("stylePrice").getElementsByTagName("span")(0).innertext
On Error GoTo 0
End Sub
20627