ASP抓取带参数的动态网页

来源:互联网 发布:鸡兔同笼编程 编辑:程序博客网 时间:2024/04/29 15:00
dim cs_idcs_id=Trim(Request.QueryString("cs_id"))Function getHTTPPage(URL)Dim http Set http = CreateObject("MSXML2.XMLHTTP") http.Open "GET", URL, False http.send If http.ReadyState <> 4 Then Exit Function End If getHTTPPage = BytesToBstr(http.responseBody, "GB2312") Set http = Nothing If err.Number <> 0 Then err.Clear End Function Function BytesToBstr(body, Cset)Dim objstream Set objstream = CreateObject("adodb.stream") objstream.Type = 1 objstream.Mode = 3 objstream.Open objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset BytesToBstr = objstream.ReadText objstream.Close Set objstream = Nothing End Functionresponse.Write getHTTPPage("http://kukusoft.net/kukusoft/CustomerService/V1.0/CustomerService_json/?cs_id="&cs_id&"&date="&now())'后面的那个date参数是必须的,否则无法实时获取动态信息

0 0
原创粉丝点击