只看楼主 楼主

在线求助小偷ASP代码

Server.ScriptTimeOut=120
on error resume next  
url="http://www.baidu.com/s?wd="&Y
softcode=getHTTPPage(url) '赋值softcode等于函数getHTTPPage的值
if err.number=0 then  '如果没有错误
start=Instr(softcode,"<HTML>")    '开始点为softcode中<HTML>标签开始
over=Instr(softcode,"<HTML>")   '结束点为softcode中<HTML>标签结束
musicOverId=ubound(Split(mid(softcode,start,over-start),"相关搜索"))-1  
'mid返回softcode中<HTML></html>之间的内容 Split用A去分割此内容 ubound分割后数组的下限
if musicOverId<>"" then '如果musicOverId不为空
for MusicStartID=1 to Gjc  '从1开始循环
start=Instr(softcode,"相关搜索"&MusicStartID&"<tr><td>&nbsp;</td></tr></table>") '重新获得开始点的值
if musicOverId=musicOverId then
over=Instr(softcode,"</body>") '重新获得结束点的值
else
over=Instr(softcode,"相关搜索"&MusicStartID+1&"<tr><td>&nbsp;</td></tr></table>")
end if
Txt=mid(softcode,start,over-start)  '截取字符串
start=Instr(Txt,"tn=baidur>")+10  '重新定义开始点的值 Txt中 tn=baidur>的点加10
over=Instr(Txt,"</a>")
Txts=mid(Txt,start,over-start)  '截取字符串

这套程序.我想抓百度下面的相关搜索的字符串,一直抓取不到..那里错了?
海军的签名

 TOP

只看该用户 沙发

Re:在线求助小偷ASP代码

不是很懂

 TOP