shahin
Active Member
Hi there everybody! I've written a code to fetch the name of a restaurant using its phone number applying "GET" http method but what i'm doing wrong with this process is beyond my knowledge. So, if anybody extends a helping hand to resolve this issue, i would be very grateful to him. Thanks in advance.
Code:
Sub test()
Dim xmlhttp As New MSXML2.XMLHTTP60, myHtml As New HTMLDocument
Dim PostData As String, ele As Object, thing As Object
Dim x As Long
x =2
PostData ="what=5197365924"
xmlhttp.Open "GET","http://mobile.canada411.ca/search/"& PostData,False
xmlhttp.setRequestHeader "Content-Type","text/xml"
xmlhttp.send
myHtml.body.innerHTML = xmlhttp.responseText
Set ele = myHtml.getElementsByClassName("merchant-title__name jsShowCTA")
For Each thing In ele
Cells(x,1)= thing.innertext
x = x +1
Next thing
EndSub