<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<%Response.charset = "utf-8"%>
<html>
<head>
</head>
<body>
<%
Function getHTTPPage(url)
dim objXML
set objXML=createobject("MSXML2.XMLHTTP")'定义
objXML.open "GET",url,false'打开
objXML.send()'发送
If objXML.readystate<>4 then '判断文档是否已经解析完,以做客户端接受返回消息
exit function
End If
getHTTPPage=BytesToBstr(objXML.responseBody)' 返回信息,同时用函数定义编码
set objXML=nothing'关闭
if err.number<>0 then err.Clear
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<=0 then Newstring=Len(wstr)
End Function
Function BytesToBstr(body)
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 = "UTF-8"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
end Function
url="https://www.ysidc.top/9207.html"
wstr=getHTTPPage(url)
response.write wstr
%>
<br><br>
</body>
</html>
把代码保存为asp文件,上传到空间,直接访问,即可测试抓取。









![[转]TCP 三次握手建立连接,四次挥手断开连接,图解详细分析_西数超哥博客](https://www.ysidc.top/wp-content/uploads/2018/12/ee107961a73f3a18a454f7fe09722867-480x300.jpg)


