ASP读取XML实例 优酷专辑采集程序 雷锋版(2)


response.write "<center><form method=""post"" action=""../admin_add.asp"">"
response.write "<input type=""hidden"" name=""db_channel"" value="&zt_name&" /><br>"
response.write "<input type=""hidden"" name=""db_player"" value=""youku"" />"
response.write "<textarea name=""db_url"" rows=""15"" cols=""100"">"
for j=0 to ChannelList.length-1
dim ibb
response.write ""&ChannelList.item(j).childnodes(0).text&"$"&ChannelList.item(j).childnodes(8).text&chr(13)&""
ibb=ibb+1
next
response.write "</textarea><br /><input type=""submit"" value=""修改好了提交"" /></form></center>"
response.write "<div align=""center""><h4>共提取到:<font color=red>"&ibb&"</font>个节目核实后提交</h4></div><br>"
end if
end if
%>
<%End If %>

以上程序是以优酷的专辑列表为例做的一个 asp读取xml的实例!
将以上代码保存为 XML.ASP 在IIS环境下运行就可以采集优酷专辑的数据了!

其实上面的获取的是下面的xml文件
复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>
<!-- generator="Novajax Feed Writer" -->
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>优酷-专辑-乾隆与香妃(27集)的视频</title>
<description>优酷专辑乾隆与香妃(27集)的视频</description>
<link>http://www.youku.com/playlist/</link>
<lastBuildDate>Wed, 16 Dec 2009 13:34:06 +0800</lastBuildDate>
<generator>Novajax Feed Writer</generator>
<image>
<url>http://www.youku.com/index/img/youkulogo.gif</url>
<title>优酷网-中国第一视频网,提供视频播放,视频发布,视频搜索</title>
<link>http://www.youku.com</link>
<description>视频服务平台,提供视频播放,视频发布,视频搜索、视频分享</description>
</image>
<item>
<title>乾隆与香妃01</title>
<link>http://www.youku.com/v_show/id_XMTM4NTY5NDk2_rss.html</link>
<description><![CDATA[<a href="http://www.youku.com/v_show/id_XMTM4NTY5NDk2_rss.html"><img src="http://g3.ykimg.com/0100641F464B178EA61F9F011876CAD9220D5D-8DAE-B491-FD1B-138F2DC75B23" border="0" width="120" height="90" vspace="4" hspace="4" title="乾隆与香妃01" target="_blank" /></a> <a href="http://www.youku.com/v_show/id_XMTM4NTY5NDk2_rss.html"><img src="http://g1.ykimg.com/" border="0" width="120" height="90" vspace="4" hspace="4" title="乾隆与香妃01" target="_blank" /></a> <a href="http://www.youku.com/v_show/id_XMTM4NTY5NDk2_rss.html"><img src="http://g1.ykimg.com/" border="0" width="120" height="90" vspace="4" hspace="4" title="乾隆与香妃01" target="_blank" /></a> <p></p>]]></description>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2222.html