Ниже приведен исходный код, укажите его как файл .asp
Кода -копия выглядит следующим образом:
<%
bpn = request ("bpn")
if (bpn = "") тогда
bpn = "0"
эндиф
intbpn = cint (bpn)
ifrequest ("action") = "1" Тогда
Word = запрос ("Word")
url = запрос ("url")
ifword <> "" Тогда
getCategories ()
ifurl <> "" Тогда
getCategories2 ()
эндиф
эндиф
эндиф
FunctiongetCategories ()
Ответ.
OnerRorResumenext
Dimoxmlhttp
Рамокатегории
DimbodyText
Dimpos, pos1
Setoxmlhttp = 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, "<таблица")
ST = 5
fori = 1to10
thei = st+i
Pos = instr (bodytext (thei), "<td")
pos1 = instr (bodytext (thei), "</td>")
Body = mid (bodytext (thei), pos, len (bodytext (thei))-pos)
body1 = split (тело, "<br>")
Название = Body1 (0)
theurl = body1 (2)
theurl = reply (theurl, «больше результатов на», «»)
response.write ("t:" & title)
response.write ("<br>")
response.write ("u:" & theurl)
response.write ("<br> <hr>")
следующий
Setoxmlhttp = ничего
iferr.number <> 0then
Был ответ ошибки. Writh "response.write, Ошибка Ошибка:" & err.description & "<br> Источник ошибки" & err.source
response.end ()
эндиф
Конечная функция
FunctiongetCategories2 ()
OnerRorResumenext
Dimoxmlhttp'asobject
Dimocategories'asobject
DimbodyText
Dimpos, pos1
Setoxmlhttp = createObject ("microsoft.xmlhttp")