ASP调用远程XML数据的代码(alexa排名数据) 复制代码 代码如下: <% URL="http://news.163.com/special/00011K6L/rss_newstop.xml" Set xml = Server.CreateObject("Microsoft.XMLHTTP") xml.Open "GET", url, False xml.Send Set xmlDom = server.createObject("microsoft.xmldom") xmlDom.async=False xmlDom.ValidateOnParse=false xmlDom.load(xml.responseXML) if xmlDom.ReadyState>2 Then set oItem=xmlDom.getElementsByTagName("item") %> <% for i=0 to oItem.length-1 word=oItem(i).childNodes(0).text title=oItem(i).childNodes.item(0).text Link=oItem(i).childNodes.item(1).text pubDate=oItem(i).childNodes.item(3).text %> <% next end if %>
·<%=word%> (<%=pubdate%>)
远程文件的内容如下: 复制代码 代码如下: 网易头条新闻 http://news.163.com/ 网易头条新闻 Wed, 16 Feb 2011 02:59:02 GMT Wed, 16 Feb 2011 02:59:02 GMT <![CDATA[一线城市房租连涨]]> http://news.163.com/11/0216/10/6T0NIHOA00014JB6.html ...... 2011-02-16 10:59:02 <![CDATA[山东部分面粉厂因农民惜售商人囤粮停产]]> http://focus.news.163.com/11/0216/11/6T0R9MIE00011SM9.html ...... 2011-02-16 11:30:40