高分求一正则或不用正则,但同样实现相同效果

opolmzy 2004-10-25 12:05:27
http://www.cp114.com/province.asp?Page=4&ID=上海


页面

单位名称:上海福和纸业发展有限公司
地  址:上海市虹口区东江湾路580弄1号108室
法人代表:王忠杰(经理) 邮政编码:200081
电  话:021-65405199 传  真:65405199
------------------------------------
1、单位名称 2、地  址 3、法人代表 4、邮政编码 5、电  话 6、传  真
------------------------------------

现在只需要以上的数据,通过xmlhttp获取过来,但怎么截取这些数据,并一条一条的传至数据库


高分相求,拜托拜托
...全文
217 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
opolmzy 2004-10-25
  • 打赏
  • 举报
回复
你这个不行,我需要对整个页取数据,起码要循环取出,再传
xuanxingmin 2004-10-25
  • 打赏
  • 举报
回复
可以试试这个:
function mysplit(str)
dim longstr
if trim(str)="" or str=null then exit function
str=split(str,":")
for i=0 to str.ubound/2
longstr=longstr&"(i+1)、"&str[2i]&""
next
mysplit=longstr
end function

引用:
str="单位名称:上海福和纸业发展有限公司 地  址:上海市虹口区东江湾路580弄1号108室"&
"法人代表:王忠杰(经理) 邮政编码:200081 电  话:021-65405199 传  真:65405199 "
response.write mysplit(str)
opolmzy 2004-10-25
  • 打赏
  • 举报
回复
自己顶一个
opolmzy 2004-10-25
  • 打赏
  • 举报
回复
忙死了
zjyfc 2004-10-25
  • 打赏
  • 举报
回复
这样的问题本来就应该自己解决。
总不能不论什么代码都让别人帮写吧。
opolmzy 2004-10-25
  • 打赏
  • 举报
回复
谢谢各位,在领导的监督下,还是自己来写了一个,已经ok了,几十万的数据呀
DeltaCat 2004-10-25
  • 打赏
  • 举报
回复
还是比较简单的, 它的数据很有规则的啊
它所有的公司信息都放在一个 TABLE 里了

先把这个TABLE 整个拿出来, 其他部分丢掉

因为TABLE 是 二维的, 和EXCEL 很像, 可以按照 TABLE 的CELL 来取值, 比较简单
opolmzy 2004-10-25
  • 打赏
  • 举报
回复
比如这样一段,然后把他们作为一条一条循环取出
opolmzy 2004-10-25
  • 打赏
  • 举报
回复
数据已经取过来了,但需要拆分
手机APP开发 2004-10-25
  • 打赏
  • 举报
回复
中午无聊啊~~~~
准备破解http://www.deleteddomains.com的代码,结果没有成功,因为有验证码。修改一下吧
<%

dz=request("dz")
dt=request("dt")
db=request("db")
stt1=request("stt1")
str1=request("str1")
stt2=request("stt2")
str2=request("str2")
lct=request("lct")
lc=request("lc")
xh=request("xh")
xd=request("xd")

if xh="" then
xh=0
end if
if xd="" then
xd=0
end if

Function bytes2BSTR(vIn) '==== 字符转换,你也可以让它来转换其它网站中的网页文件
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function


dim Sword,page,Url,SourceCode,Setop,Scondent,SeEnd,SePage,oSend
dim tt1,tt2
dim betw,first
dim num1,num2,i

cid="10888-16772"
sid="14185"


'Url = "http://www.deleteddomains.com/cgi-bin/browse.pl?cid="&cid&"&sid="&sid&"&dz="&dz&"&dt="&dt&"&db="&db&"&stt1="&stt1&"&str1="&str1&"&stt2="&stt2&"&str2="&str2&"&lct="&lct&"&lc="&lc&"&xh="&xh&"&xd="&xd&""
url="http://www.deleteddomains.com/newlist.shtml"
set oSend=createobject("Microsoft.XMLHTTP")
SourceCode = oSend.open ("GET",url,false)
oSend.send()
SourceCode = bytes2BSTR(oSend.responseBody)

betw=instr(SourceCode,"><b>click here</b>")
first=instr(SourceCode,"<a href=""/search.shtml?cid=")

SourceCode = Mid(SourceCode,first,abs(betw))

'==========================================

betw=instr(SourceCode,"""><b>")
first=instr(SourceCode,"cid=")

SourceCode = Mid(SourceCode,first,abs(betw))

betw=instr(SourceCode,"""")
first=instr(SourceCode,"cid=")

SourceCode = Mid(SourceCode,first,abs(betw))

sourcecode=Replace(sourcecode,"""","")
sourcecode=Replace(sourcecode,"cid=","")
response.redirect "2.asp?cid="&SourceCode
response.end
%>
  • 打赏
  • 举报
回复
只能学习。。
serverme 2004-10-25
  • 打赏
  • 举报
回复
up
手机APP开发 2004-10-25
  • 打赏
  • 举报
回复
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function

28,404

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧