高分高分求解,急急急急急急急急急急急急急急急急急急急急急急急急急急!

hezhenyun 2009-03-04 04:43:42
<%
'bbs
function getHTTPPage(url)
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=bytesToBSTR(Http.responseBody,"gb2312" )
set http=nothing
if err.number<>0 then err.Clear
end function

Function 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 Function

netname=request.Form("netname")
kword=request.Form("kword")

if kword<>""then

ceshi=0
id=1
id01=0
jieguo=0

do while ceshi<300 and id01<1

Dim Html

Url="http://www.baidu.com/s?lm=0&si=&rn=10&ie=gb2312&ct=0&wd="&kword&"&pn="&ceshi&"&ver=0&cl=3"

Html = getHTTPPage(Url)


if InStr(Html,netname)<>0 then




do while InStr(Html,"'url':this.href,'p1':")<>0

Html=Mid(Html,InStr(Html,"'url':this.href,'p1':"),len(Html))
a1=InStr(Html,"'url':this.href,'p1':")
a2=InStr(Html,"target")
a3=Mid(Html,a1,a2-a1+6)
a4=Mid(Html,a1+len("'url':this.href,'p1':"),1)
if IsNumeric(a4)<>0 then
if InStr(a3,netname)<>0 and a4<> 0then
a4=Mid(Html,a1+len("'url':this.href,'p1':"),3)
a4=replace(a4,")","")
response.write "<font color=red size=+3>搜索结果为:</font>在百度的第"&id&"页 第"&a4&"位!<br>"
'response.write a3&"<br>"
Html="w23"
id01=id01+1
id2=id
end if
end if
Html=replace(Html,a3,"")

loop



end if
id=id+1
ceshi=ceshi+10

loop

if id01<1 then
response.write "未出现在前5页搜索结果中."
end if

end if

%>
本段代码是跟据网址,关键字进行查询百度的具体排名,现在是查询前五页的情况,我现在想改成查询前二十页的情况,不知道怎样修改,嘿,请各位解答解答,谢谢!!!!!!1
...全文
72 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aemyang1987 2009-03-04
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xiaofanku 的回复:]
a3=Mid(Html,a1,a2-a1+6)
把6改成21试试!
[/Quote]
可行!
街头小贩 2009-03-04
  • 打赏
  • 举报
回复
a3=Mid(Html,a1,a2-a1+6)
把6改成21试试!

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧