一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專(zhuān)注于服務(wù)器技術(shù)及軟件下載分享
分類(lèi)導(dǎo)航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達(dá)式|C/C++|IOS|C#|Swift|Android|VB|R語(yǔ)言|JavaScript|易語(yǔ)言|vb.net|

服務(wù)器之家 - 編程語(yǔ)言 - ASP教程 - 可以查詢(xún)百度排名的asp源碼放送了

可以查詢(xún)百度排名的asp源碼放送了

2019-10-23 12:20asp代碼網(wǎng) ASP教程

可以查詢(xún)百度排名的asp源碼放送了,需要的開(kāi)發(fā)者可以參考下.

以下是源碼,請(qǐng)命名為.asp文件 

復(fù)制代碼代碼如下:


<%  
bpn = request("bpn")  
if(bpn = "") then  
 bpn = "0"  
end if  
intbpn = cint(bpn)  

if request("action") = "1" then  
 word = request("word")  
 url = request("url")  
 if word <> "" then  
  getCategories()    
  if url <> "" then  
   getCategories2()  
  end if  
 end if  
end if  

Function getCategories()  

response.write("<b>'"&word&"' 關(guān)鍵詞在百度搜索排名中,前10位網(wǎng)站!</b><br>")  

on error resume next  
Dim oXMLHTTP   
Dim oCategories   
Dim BodyText  
Dim Pos,Pos1  
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")  

oXMLHTTP.open "GET","http://www.baidu.com/baidu?word="&word,False    
oXMLHTTP.send   

 BodyText=oXMLHTTP.responsebody  
 BodyText=BytesToBstr(BodyText,"gb2312")  
 Pos=Instr(BodyText,"<body")  
 pos1=Instr(BodyText,"</body>")  
 BodyText=mid(BodyText,pos,pos1)  

 BodyText=split(BodyText,"<table")  

 st = 5  
 for i = 1 to 10  
   thei = st + i  
  Pos=Instr(BodyText(thei),"<td")  
  pos1=Instr(BodyText(thei),"</td>")  
  Body=mid(BodyText(thei),pos,len(BodyText(thei))-pos)  

  body1=split(body,"<br>")  

  title = body1(0)  
  theurl = body1(2)  
  theurl = replace(theurl,"上的更多結(jié)果","")  
  response.write ("T:"& title)  
  response.write ("<br>")  
  response.write ("U:"& theurl)  
  response.write ("<br><hr>")  
 next  

Set oXMLHTTP = Nothing   
if err.number<>0 then  
response.write "出錯(cuò)了,錯(cuò)誤描述:"&err.description & "<br>錯(cuò)誤來(lái)源"& err.source  
response.End()  
end if  
End Function   


Function getCategories2()  
on error resume next  
Dim oXMLHTTP ' As Object  
Dim oCategories ' As Object  
Dim BodyText  
Dim Pos,Pos1  
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")  

out = 0  
pn = 0  
pp = 0  
do while(true)  

strurl="http://www.baidu.com/baidu?word="&word&"&pn="&cint(pn)+intbpn*10  
//response.write(strurl&"<br>")  

oXMLHTTP.open "GET",strurl,False    
oXMLHTTP.send   

 BodyText=oXMLHTTP.responsebody  
 BodyText=BytesToBstr(BodyText,"gb2312")  
 Pos=Instr(BodyText,"<body")  
 pos1=Instr(BodyText,"</body>")  
 BodyText=mid(BodyText,pos,pos1)  

 BodyText=split(BodyText,"<table")  

 st = 5  
 thei = 0  
 for i = 1 to 10  
   thei = st + i  
  //response.write(thei)  
  Pos=Instr(BodyText(thei),"<td")  
  pos1=Instr(BodyText(thei),"</td>")  
  Body=mid(BodyText(thei),pos,len(BodyText(thei))-pos)  

  Pos3=Instr(Body,url)  
  if Pos3 > 0 then  
   pp = pn + i  
   out = 1  
   Exit For  
  end if  
 next  


 if out = 1 or pn = 90 then  
  exit do  
 end if  

 pn = cint(pn)+10  
loop  
if pp <> 0 then  
 response.write("<br><br>網(wǎng)站 <b>'"&url&"'</b> 在搜索關(guān)鍵詞 <b>'"&word&"'</b> 時(shí)在百度中排名名次 第<b> "&pp+intbpn*10&" </b>位 ")  
else  
 response.write("<br><br>網(wǎng)站 <b>'"&url&"'</b> 在搜索關(guān)鍵詞 <b>'"&word&"'</b> 時(shí)在百度中排名名次 <font color=red>未在"&intbpn*10+1&"名到"&intbpn*10+100&"內(nèi)</font>")  
end if  


Set oXMLHTTP = Nothing   
if err.number<>0 then  
response.write "出錯(cuò)了,錯(cuò)誤描述:"&err.description & "<br>錯(cuò)誤來(lái)源"& err.source  
response.End()  
end if  

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  
Public Function HTMLEncode(fString)  
  If Not IsNull(fString) Then  
   fString = replace(fString, ">", ">")  
   fString = replace(fString, "<", "<")  
   fString = Replace(fString, CHR(32), " ")  '   
   fString = Replace(fString, CHR(9), " ")   '   
   fString = Replace(fString, CHR(34), """)  
   fString = Replace(fString, CHR(39), "'") '單引號(hào)過(guò)濾  
   fString = Replace(fString, CHR(13), "")  
   fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")  
   fString = Replace(fString, CHR(10), "<BR> ")  
   HTMLEncode = fString  
  End If  
 End Function  




%>  
<title>關(guān)鍵字,網(wǎng)站在百度中排名查詢(xún)</title>  
<hr><hr><b>  
關(guān)鍵字,網(wǎng)站在百度中排名查詢(xún):  
<form name="form1" method="post" action="?action=1">  
  網(wǎng)址:  
    <input type="text" name="url" value="<%=url%>">  
 關(guān)鍵字:  
 <input type="text" name="word" value="<%=word%>">  
 查詢(xún)范圍:  
 <select name="bpn">  
  <option value="0" <%if(bpn = "0")then response.write("selected") end if%>>1-100</option>  
  <option value="10" <%if(bpn = "10")then response.write("selected") end if%>>101-200</option>  
  <option value="20" <%if(bpn = "20")then response.write("selected") end if%>>201-300</option>  
  <option value="30" <%if(bpn = "30")then response.write("selected") end if%>>301-400</option>  
  <option value="40" <%if(bpn = "40")then response.write("selected") end if%>>401-500</option>  
  <option value="50" <%if(bpn = "50")then response.write("selected") end if%>>501-600</option>  
  <option value="60" <%if(bpn = "60")then response.write("selected") end if%>>601-700</option>  
  <option value="70" <%if(bpn = "70")then response.write("selected") end if%>>701-800</option>  
  <option value="80" <%if(bpn = "80")then response.write("selected") end if%>>801-900</option>  
  <option value="90" <%if(bpn = "90")then response.write("selected") end if%>>901-1000</option>  
 </select>  

  <input type="submit" name="Submit" value="提交">  
</form> 

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲精品一线二线三线 | 国产一级免费片 | 亚洲免费视频在线观看 | 狠狠色成人综合网图片区 | 国产精品永久免费视频 | 亚洲v日韩v欧美在线观看 | 国产专区日韩精品欧美色 | 亚洲天堂视频在线观看 | 三年片韩国在线 | 日韩一级片免费观看 | 美女舒服好紧太爽了视频 | 亚洲人成激情在线播放 | 国产一级毛片国语版 | 男人叼女人的痛爽视频免费 | 国产精品久久久久毛片真精品 | 国产在视频线精品视频 | 欧美精品v欧洲高清 | 日本加勒比在线精品视频 | 国产伦精品一区二区三区免费观看 | 国产成人精品在线观看 | 亚洲精品在线免费观看视频 | 黑人艹 | 精品欧美一区二区三区在线观看 | 日本人与黑人做爰视频网站 | 欧乱色国产精品兔费视频 | 国产午夜精品一区二区三区不卡 | 四虎影院网址大全 | 精品久久久久久影院免费 | 狠狠色| 精品综合久久久久久88小说 | 日本视频免费看 | 日韩免费视频播播 | 日本在线视频免费观看 | japaneseles女同专区 | 日日本老女人 | 共妻高h| 国产精品视频视频久久 | 日韩 国产 欧美 精品 在线 | 久久er国产免费精品 | 色噜噜狠狠狠综合曰曰曰88av | 34g污奶跳舞 |