S.Write Bdat
ADOS.Position = 0
ADOS.Type = 2
ADOS.Charset = "GB2312"
BytesToBstr = ADOS.ReadText
ADOS.Close
End Function
Public Function GetData(byref url)
''on error resume next
SourceCode = OXML.open ("GET",url,false)
OXML.send()
if OXML.readystate<>4 then exit function
GetData = BytesToBstr(OXML.responseBody)''
if err.number<>0 then err.Clear
End Function
mydate=getdata(url)
mydate=Replace(mydate,chr(34),"") ''去掉一些特殊字符,如双引号等,看自己情况定
mydate=Replace(mydate,chr(16),"")
Public Function finddate(byref str,byref start,byref last,byref n)
If Instr(lcase(str),lcase(start))>0 then
select case n
case 0 ''左右都截取(都取前面)(去处关键字)
finddate=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
finddate=Left(finddate,Instr(lcase(finddate),lcase(last))-1)
case 1 ''左右都截取(都取前面)(保留关键字)
finddate=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
finddate=Left(finddate,Instr(lcase(finddate),lcase(last))+Len(last)-1)
end select
Else
finddate=""
End if
end function
dim title,artor,content,wherefrom
title=finddate(mydate,"width=540 borderColorDark=#ffffff
borderColorLight=#cccccc","</font></b>",1)
title=finddate(title,"<font color=''#000000''>","</font></b>",0)
artor=finddate(mydate,"作者:</b>"," <b>",0)
wherefrom=finddate(mydate,"来源:</b><font color=#000000>","</font> ",0)
content=finddate(mydate,"</td></tr><tr><td><br>","<br><br><iframe name=import_frame",0)
call intomdb(title,artor,content,wherefrom)
function intomdb(title,artor,content,wherefrom)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''这个是入库的函数,自己定义下就可以了
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
end function
%>
我这里只是以采集文章为例,其它的采集软件等都是这个道理。
说了怎么多,我也不知道各位能不能看懂,如看不动那可能是我不会表达了,大家见谅。毕竟我没读过文
科,^_^
我只是讲原理,
程序是靠自己写的,要采集的速度快,你还可以写成exe的啊,这样比较快,占内存少