El siguiente es el código fuente, por favor, asígnele. Archivo ASP.
La copia del código es la siguiente:
<metahttp-equiv = "content-type" content = "text/html; charset = gb2312">
<%
ifRequest ("acción") = "1" entonces
word = request ("Word")
url = request ("url")
ifword <> "" entonces
getCategories ()
ifurl <> "" entonces
getCategories2 ()
endif
endif
endif
FunctetCategories ()
Response.write ("<b> '" & Word & "' La palabra clave se encuentra entre los 10 sitios web principales en el ranking de búsqueda de Google! </b> <br>")
onerrorResumEnext
DIMOXMLHTTP
Dimocategorías
DimbodyText
Dimpos, pos1
Satexmlhttp = createObject ("Microsoft.xmlhttp")
http = "http://www.google.com/search?q=" & word & "& hl = en-cn"
oxmlhttp.open "get", http, falso
oxmlhttp.send
BodyText = oxmlhttp.ResponseBody
BodyText = ByTestObstr (BodyText, "UTF-8")
Pos = instr (bodyText, "<cuerpo")
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
Satexmlhttp = nada
iferr.number <> 0then
Hubo una respuesta de error. Write "Response.Write, Error Descripción:" & Err.Description & "<br> Fuente de error" & Err.Source
respuesta.end ()
endif
Función final
FunctetCategories2 ()
onerrorResumEnext
DIMOXMLHTTP'ASObject
Dimocategorías'asObject
DimbodyText
Dimpos, pos1
Satexmlhttp = createObject ("Microsoft.xmlhttp")