A seguir, o código -fonte, por favor, nomeie -o como arquivo .asp
A cópia do código é a seguinte:
<%
bpn = request ("bpn")
if (bpn = "") então
bpn = "0"
endif
intbpn = cint (bpn)
ifRequest ("ação") = "1" então
palavra = solicitação ("word")
url = solicitação ("url")
ifword <> "" então
getCategories ()
ifurl <> "" então
getCategories2 ()
endif
endif
endif
FunctionGetCategories ()
Response.Write ("<b> '" & Word & "' Palavra -chave está entre os 10 principais sites do ranking de pesquisa do Baidu! </b> <br>")
OnErrorReSumenext
DIMOXMLHTTP
Dimocategorias
DimbodyText
DIMPOS, POS1
SedexmlHttp = 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, "<tabela")
ST = 5
fori = 1to10
thei = st+i
POS = Instr (BodyText (Thei), "<TD")
POS1 = Instr (BodyText (Thei), "</td>")
Corpo = médio (BodyText (thei), pos, Len (BodyText (thei))-POS)
corpo1 = dividido (corpo, "<br>")
title = body1 (0)
theurl = body1 (2)
theurl = substituir (theurl, "mais resultados em", "")
Response.Write ("T:" & Título)
Response.Write ("<br>")
Response.Write ("U:" & theurl)
Response.Write ("<br> <HR>")
próximo
SedexmlHttp = nada
iferr.number <> 0then
Houve uma resposta de erro.Write "Response.Write, Erro Descrição:" & Err.Description & "<br> Fonte de erro" & Err.Source
Response.end ()
endif
Função final
FunctionGetCategories2 ()
OnErrorReSumenext
DimoxmlHttp'asObject
Dimocategories'asObject
DimbodyText
DIMPOS, POS1
SedexmlHttp = CreateObject ("Microsoft.xmlHttp")