Collection principle:
The main steps of the collection procedure are as follows:
1. Obtain the content of the collected page
2. Extract all the data used from the acquisition code
1. Obtain the content of the collected page
I currently know the commonly used methods of obtaining collected pages in ASP:
1. Use serverXMLHTTP component to obtain data
Function GetBody(weburl)
'-----------------------Zhai Zhenkai (Xiao Qi)
'Create an object
Dim ObjXMLHTTP
Set ObjXMLHTTP=Server.CreateObject("MSXML2.serverXMLHTTP")
'Request file, in asynchronous form
ObjXMLHTTP.Open "GET",webuurl,False
ObjXMLHTTP.send
While ObjXMLHTTP.readyState <> 4
ObjXMLHTTP.waitForResponse 1000
Wend
'Get the result
GetBody=ObjXMLHTTP.responseBody
'Release the object
Set ObjXMLHTTP=Nothing
'-----------------------Zhai Zhenkai (Xiao Qi)
End Function
Call method: GetBody (the URLf address of the file)
2. Or XMLHTTP component to obtain data
Function GetBody(weburl)
'-----------------------Zhai Zhenkai (Xiao Qi)
'Create an object
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", weburl, False, "", ""
.Send
GetBody = .ResponseBody
End With
'Release the object
Set Retrieval = Nothing
'-----------------------Zhai Zhenkai (Xiao Qi)
End Function
Call method: GetBody (the URLf address of the file)
The data obtained in this way also needs to be encoded and converted before it can be used
Function BytesToBstr(body,Cset)
'-----------------------Zhai Zhenkai (Xiao Qi)
dim objstream
set objstream = Server.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
'-----------------------Zhai Zhenkai (Xiao Qi)