Page
<title>AUTOGET</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body bgcolor= "#FFFFFF" >
<% ' On Error Resume Next
'-----------to build an access table called data, field (name, source, content)
Set conn = Server.CreateObject ("ADODB. Connection ")
DBPath = Server.MapPath ("Data.mdb")
Conn. Open driver={microsoft Access Driver (*.mdb)};d bq= "& DBPath &";
Set rs = Server.CreateObject ("ADODB.") Recordset ")
Sql= "SELECT * from Data"
Rs.Open sql,conn,3,2
' The above completed table open
Set httpobj = Server.CreateObject ("Asphttp.conn")
Dim fd
FD = 111
SearchFolder FD
' The following is the process
Sub SearchFolder (FD)
Do While FD <> 500
Response.Write FD
Httpobj.url = "http://www.object.net/Read.asp?ArticleID=" &fd
Httpobj.requestmethod = "Get"
Content = Httpobj.geturl
' Take the title Pos0=instr (1,content, "Pos1=instr (pos0,content, ">")
Pos2=instr (pos1,content, "</td>")
Title=mid (Content,pos1+1,pos2-pos1-1)
' Source <td>
Pos=instr (pos2,content, "<td>")
Pos1=instr (pos,content, "</td>")
Comefrom=mid (content,pos+4,pos1-pos-4)
' Idno
Pos1=instr (1,content, "ArticleID")
Pos2=instr (pos1,content, ">")
Idno=mid (CONTENT,POS1+10,POS2-POS1-10)
' Content
Pos1=instr (1,content, "<blockquote>")
Pos2=instr (pos1,content, "</blockquote>")
Content=mid (content,pos1+12,pos2-pos1-12)
' The following database operations:
Rs.addnew
RS ("name") =title
RS ("source") =comefrom
RS ("Contents") =trim (content)
RS ("Idno") =trim (Idno)
Rs.update
FD=FD + 1
Loop
End Sub
' The process is over
Response.Write fd& "<br>"
Rs.close
Set conn=nothing
Set fs=nothing
%>
</body>