100紧急求助!!vbs脚本语言写的xml解析远程网页的代码!
代码如下:
<%
dim objXML
dim objRootElement
dim strValue
dim strInetURL
dim strXML
dim item
strInetURL ="http://www.178cpw.com/shishicai/xmlgetjg.asp"
Dim HttpReq
set HttpReq = server.CreateObject("MSXML2.XMLHTTP")
HttpReq.open "GET", strInetURL, False
HttpReq.send
strXML = HttpReq.responseText
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
objXML.validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
if objXML.ParseError.errorCode <> 0 then
Response.Write("Error: " & objXML.parseError.reason & "<br>")
Response.Write("Code: 0x" & hex(objXML.parseError.errorCode) & "<br>")
Response.Write("At Line: " & objXML.parseError.line & "<br>")
Response.Write("At pos: " & objXML.parseError.linePos & "<br>")
else
set objRootElement = objXML.documentElement
if not isObject(objRootElement) then
Response.Write("no file loaded")
else
response.write(text)
end if
end if
%>
<meta http-equiv="refresh" content="60; ">
问题是:我是动态获得远程网页的数据,因为他的数据也是不断更新的,我挂在空间后,获得数据老是没有更新的,也就是说之前时刻的数据。不知道是主机服务器空间的问题还是代码有问题呢?很急,多谢大为大哥
[解决办法]
见以下贴子:
XML/SOAP版的同一贴子解决办法