Sub httpRequest() Dim HttpReq As MSXML2.XMLHTTP Dim DomDoc As MSXML2.DOMDocument Dim targetURL As String targetURI = "http://maps.google.co.jp/maps/geo?key=&output=xml&q=" & EncodeURI("大宮市吉野町1-1-2") 'HTTP GET Set HttpReq = CreateObject("MSXML2.XMLHTTP") HttpReq.Open "GET", targetURI, False HttpReq.send (Null) 'XML PARSE Set DomDoc = CreateObject("MSXML2.DOMDocument") DomDoc.LoadXML (HttpReq.responseText) Set HttpReq = Nothing Set DomDoc = Nothing End Sub Function EncodeURI(uri As String) As String Set sc = CreateObject("ScriptControl") sc.Language = "JScript" Set js = sc.CodeObject EncodeURI = js.encodeURIComponent(uri) End Function
参考URL、ありがとう!
URL1
URL2
0 件のコメント:
コメントを投稿