50元,采集一个网站开奖号码,然后把号码保存到变量。asp的代码。我这里有参考 但是不知道那里出错了。不能采集了。
QQ:859396272在线等,请大家帮忙!
<META http-equiv=Content-Type content="text/html; charset=gb2312" ;>
<META http-equiv=Expires content=0>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Pragma content=no-cache>
<style type=text/css>
li {list-style:none;}
body {font-family:  Arial; font-size:  12px;color: #000000;}
td {font-family:  Arial; font-size:  12px;line-height:20px;}
a:link,a:visited{text-decoration: none; color:  #000000}
a:hover {  color:  #ff0000; text-decoration: underline}
</style>
<META content="MSHTML 6.00.2800.1586" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff topMargin=5 marginheight="5">
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><strong>最新开奖号码同步工具-网赚之家制作-www.pany.net.cn</strong></td>
  </tr>
  <tr>
    <td>
<%dim rs,sql
dim strUrl,strinfo
dim viewinfo,strArray_Temp
dim strArraya(500),strArrayb(500),strArrayc(500)
dim strArray(500),strArray2(500),i
dim pagestrinfo1 = GetHTTPPage("http://www.shishicai.cn/Assist/BonusVideo.aspx?lt=21")
viewinfo1 = strCut(strinfo1,"Assist/BonusRecent.aspx?lt=21&d=","""",2)strUrl="http://soft.shishicai.cn/Assist/BonusRecent.aspx?lt=21&d="&viewinfo1 strinfo = GetHTTPPage(strUrl)
   response.write strUrl
 viewinfo = strCut(strinfo,"<td>开奖号码</td>","</table>",2)
   response.write  "<strong>目标网址:</strong>" &strUrl&"<br>"
strArray_Temp = Split(viewinfo ,"<tr>")
iNa=Ubound(strArray_Temp)
for i = iNa to 1 step   -1



strArraya(i) = trim(strCut(strArray_Temp(i),"<td>","</td>",2))
    strArrayb(i) = strCut(strArray_Temp(i),"</td>","</tr>",2)
    strArrayc(i) = trim(strCut(strArrayb(i),"<td>","</td>",2))

if strArraya(i)<>"" then  

 response.write"   <iframe name=""frmUserLongin"" src=/ht/lottery/chkwin_auto.asp?lt=hsc&cp_num="&strArraya(i)&" frameborder=0 scrolling=""no""></iframe>" newday=cdate(date())
daynum= datediff("d","2009-9-25",newday)
pany_lotterynum_n=right(strArraya(i),4)
pany_lotterynum_m=6636+(int(daynum))*84
pany_lotterynum_mn=pany_lotterynum_n-pany_lotterynum_m


if pany_lotterynum_mn>=1 then
lottery_days=int(pany_lotterynum_n-6636)/84
riqi=DateAdd("d",lottery_days,"2009-9-25")







Daten=int(pany_lotterynum_mn)*10

NewDate=  formatdateTime(riqi,vbLongDate)&" 10:00:01"
NewDate = DateAdd("n",Daten,NewDate)




set rst=server.CreateObject("adodb.recordset")
rst.open "select id from hsc_info where  lottery_num='"&strArraya(i)&"'",conn,1,1
If rst.EOF And rst.BOF Then

set rs=server.createobject("adodb.recordset")
sql="select * from  hsc_info" 
rs.open sql,conn,1,3
rs.addnew rs("lottery_num")=strArraya(i)
rs("num_info1")=left(strArrayc(i),1)
rs("num_info2")=mid(strArrayc(i),2,1)
rs("num_info3")=mid(strArrayc(i),3,1)
rs("num_info4")=mid(strArrayc(i),4,1)
rs("num_info5")=right(strArrayc(i),1)


    rs("kjtime")= NewDate

rs("addtime")= now()
rs("state")= 0


rs.update
rs.close
set rs=nothingend if
 end if  end if 
     response.write  i&"<hr>"
 response.write strArraya(i)&"<br>"
    next
%>
 </td> </tr>
  <tr>
    <td></td>
  </tr>
</table>
</BODY></HTML>
<%
Function getHTTPPage(url) 
On Error Resume Next
dim http 
set http=Server.createobject("MSXML2.XMLHTTP") 
Http.open "GET",url,false 
Http.send() 
if Http.readystate<>4 then
exit function 
end if 
    getHTTPPage=Http.responsetext
    set http=nothing
If Err.number<>0 then 
getHTTPPage="0" Response.Write "" 
Err.Clear
End If  
End functionFunction BytesToBstr(body,Cset)
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
End FunctionFunction strCut(strContent,StartStr,EndStr,CutType)
Dim S1,S2
On Error Resume Next
Select Case CutType
Case 1
S1 = InStr(strContent,StartStr)
S2 = InStr(S1,strContent,EndStr)+Len(EndStr)
Case 2
S1 = InStr(strContent,StartStr)+Len(StartStr)
S2 = InStr(S1,strContent,EndStr)
End Select
If Err Then
strCute = ""
Err.Clear
Exit Function
Else
strCut = Mid(strContent,S1,S2-S1)
End If
End Function%><body onload='setTimeout("mm()",5000)'>
<script>
function mm()
{
    window.opener=null;
    window.close();

</script>
</body>