概要
vbsの作法調べてみた。
html取得、やってみた。
サンプルコード
Function GetHtml(url)
Const adTypeBinary = 1
Const adTypeText = 2
Dim oHttpReq, oStream
Dim sText
Set oHttpReq = CreateObject("MSXML2.ServerXMLHTTP.3.0")
oHttpReq.Open "GET", url, False
oHttpReq.Send
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = adTypeBinary
oStream.Write oHttpReq.ResponseBody
oStream.Position = 0
oStream.Type = adTypeText
oStream.Charset = "Shift-JIS"
sText = oStream.ReadText
oStream.Close
GetHtml = sText
End Function
Dim html
html = GetHtml("http://jsdo.it")
msgbox html
以上。