A seguir, é apresentado o código -fonte, nomeie -o. Arquivo ASP.
A cópia do código é a seguinte:
<metahttp-equiv = "content-type" content = "text/html; charset = gb2312">
<%
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 no ranking do Google Pesquisa! </b> <br>")
OnErrorReSumenext
DIMOXMLHTTP
Dimocategorias
DimbodyText
DIMPOS, POS1
SedexmlHttp = CreateObject ("Microsoft.xmlHttp")
http = "http://www.google.com/search?q=" & word & "& hl = en-cn"
oxmlHttp.open "Get", http, false
oxmlHttp.send
BodyText = oxmlHttp.ResponseBody
BodyText = Bytestobstr (BodyText, "UTF-8")
POS = Instr (BodyText, "<Body")
POS1 = Instr (BodyText, "</body>")
BodyText = MID (BodyText, POS, POS1)
POS = Instr (BodyText, "<div>")
BodyText = MID (BodyText, POS)
POS1 = Instr (BodyText, "</div>")
BodyText = MID (BodyText, 1, POS1)
'Response.Write ("::::" & BodyText & "::::")
BodyText = Split (BodyText, "<pclass = g>")
fori = 1to10
POS = Instr (BodyText (i), "</a>")
Thet = MID (BodyText (i), 1, pos+3)
POS = Instr (BodyText (i), "<spandir = ltr>")
theu = MID (BodyText (i), POS)
POS1 = Instr (Theu, "</span>")
theu = mid (theu, 1, pos1-1)
Response.Write ("T:" & thet & "<br>")
Response.Write ("U:" & theu & "<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")