高分高分求解,急急急急急急急急急急急急急急急急急急急急急急急急急急!
<%
'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