这个页面的内容怎么抓不到,求解决中..........
RT
抓取页面:http://www.cn.dhl.com/publish/cn/zh/eshipping/track.high.html?pageToInclude=RESULTS&AWB=2695691095&type=fasttrack
抓取程序如下:
<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t=GetBody(Path)
getHTTPPage=BytesToBstr(t, "GB2312 ")
End function
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
'然后调用XMLHTTP组件创建一个对象并进行初始化设置。
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject( "adodb.stream ")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring <=0 then Newstring=Len(wstr)
End Function
Dim wstr,url
url= "http://www.cn.dhl.com/publish/cn/zh/eshipping/track.high.html?pageToInclude=RESULTS&AWB=2695691095&type=fasttrack "
wstr=getHTTPPage(url)
response.write wstr
%>
解决测试通过后马上给分
------解决方案--------------------人家程序代码加处理了吧
------解决方案--------------------把 onerrorresumenext 去掉