asp采集问题

来源:百度知道 编辑:UC知道 时间:2024/06/09 03:41:31
<HTML>

<HEAD>
<TITLE>相关关键字</TITLE>
<head>
<META http-equiv=content-type content="text/html; charset=gb2312"><LINK
href="main.css" type=text/css rel=stylesheet></head>

<%
y=request("key")
if y="" then
response.write "<form method=post action=rsquery.php><input name=xkseokey size=20 value='"&y&"'><input type=hidden name=submit value=1> <input type=submit value=' 开始查询这个关键字的相关词 '></form>"
response.end
end if
response.write "<form method=post action=rsquery.php><input name=xkseokey size=20 value='"&y&"'><input type=hidden name=submit value=1> <input type=submit value=' 开始查询这个关键字的相关词 '></form>"
Server.ScriptTimeOut=120
on error resume next
a2=mid(y,1,1) & " " & mid

<%
'说明...这前要打开数据库连接对象 conn 修改下面的表名.程序没有测试.要是代码有问题百度消息我

Server.ScriptTimeOut=120
on error resume next
dim y,i,str

y=request("key")
response.write "<form method=post ><input name=key size=20 value='"&y&"' > <input type=submit value=' 开始查询这个关键字的相关词 '></form>"

if y="" then response.end

str=split(getHTTPPage("http://labs.getyacg.com/keyword-tool/?keyword="&Server.UrlEncode(y)),",")

for i =0 to ubound(str)
if str(i)<>"" then conn.execute("insert into [表名] txts values '"&replace(str(i),"'","''")&"'"):response.write str(i)&" 入库成功!<BR>"& (i+1)
next

function getHTTPPage(url)
on error resume