一段采集程序代码(2)
Response.Write ("开始采集:从"+beginid+"到"+endid+"<hr>");
Response.Flush;
OpenDatabase();
var re=new RegExp("<title>(.*?) - 彩酷</title>","ig");
for(var fi=beginid;fi<(endid+1);fi++){
tid = String(fi);
getdata = ajaxRead("http://mms.caiku.com/sendcring.aspx?uid=0&id="+tid);
if(arr = re.exec(getdata)!=null){
tstr = String(RegExp.$1);
if(tstr!=null&&tstr!="undefined"&&tstr!="")
tstr = tstr.replace("'","");
ADOConn.execute("INSERT INTO getdata(title,tid)VALUES('"+tstr+"',"+tid+")");
Response.Write (tid+":"+tstr+" ___>OK!<br>");
countid++;
Response.Flush
}
}
re.close;
CloseDatabase();
Response.Write ("<hr>采集完毕!共录入数据"+countid+"条。");
%>
内容版权声明:除非注明,否则皆为本站原创文章。