Use asp to obtain the xml file of the specified topic, and then read the list contents of the xml file in batches.
Copy the code as follows:<title>Lei Feng|Youku-Album Collection Program</title></head>
<form name=form1 method=post action=?action=add>
<table width=95% border=0 align=center cellpadding=0 cellspacing=1 class=tableBorder>
<tr><th colspan=2 align=center class=tableHeaderText><<<< <font color=red>Lei Feng|Youku-Album Collection Program</font> >>>></td></tr>
<tr><td align=center><a href=http://www.youku.com/playlist/ target=_blank>Click me to find Youku album</a>
</td>
</tr>
<tr><td bgcolor=#FFFFFF align=center>Album address: <input name=maxz type=text value=<%=Request(maxz)%> size=50></td ></tr>
<tr><td align=center bgcolor=#FFFFFF>For example album: http://www.youku.com/playlist_show/id_2344971.html</td></tr>
<tr><td align=center bgcolor=# FFFFFF><input name=action type=submit id=action value=Submit the album address for analysis></td></tr>
<tr><td align=center bgcolor=#FFFFFF></td></tr>
</table>
</form>
<%
if Request(action)=add Then
maxz=request.Form(maxz)
v_urla=Split(maxz,/id_)(1 )
v_urlb=Replace(v_urla,.html,)
v_url=http://www.youku.com/playlist/rss/id/4014024&v_urlb
response.write <div align=center><a href=&v_url& target=_blank >XML of the current album:&v_url&</a></div>
Function GetPageContent(Url)
Dim HTTPObj
On Error Resume Next
Set HTTPObj = Server.CreateObject(Microsoft.XMLHTTP )
With HTTPObj
.Open Get, Url, False, ,
.Send
End With
if HTTPObj.Readystate <> 4 then
Set HTTPObj = Nothing
GetPageContent = False
Exit Function
end if
GetPageContent = replace(HTTPObj.responseText,UTF-8,gb2312)
Set HTTPObj = Nothing
End Function
strXML=GetPageContent(&v_url&)
Set objXML = Server.CreateObject(Microsoft.XMLDOM)
objXML .validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
set objRootElement = objXML.documentElement
if not isObject(objRootElement) then
Response.Write(no file loaded)
else
Set ChannelList=objXML.getElementsByTagName(item)
if isnull(objXML.getElementsByTagName(item ) ) then
response.Write(read failed)
response.End()
else
Set Statistics=objXML.getElementsByTagName(title)
set KeywordList=objXML.getElementsbytagname(lastBuildDate)
'response.write Total: &keywordlist.length-1& channels'response.write
<div align=center><h4> Album name: &Statistics.item(0).text&</h4>
v_name=REPLACE(Statistics.item(0).text,Youku-Album-,)
zt_name=REPLACE(v_name, video,)
response.write <div align=center><h4>Album name: <font color=red> &zt_name&</font></h4>
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=modified submission/></form></center>
response.write <div align=center><h4>A total of extracted: <font color=red>&ibb&</font> Submit after verification</h4></div><br>
end if
end if
%>
<%End If %>
The above program is based on Youku’s album list as an example Example of asp reading xml!
Save the above code as XML.ASP and run it in IIS environment to collect Youku album data!
In fact, what is obtained above is
the copy code of the following xml file. The code is as follows:
<?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>Youku-Album-Video of Qianlong and Xiangfei (Episode 27)</title>
<description>Video of Youku Album Qianlong and Xiangfei (Episode 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>Youku.com - China's No. 1 video network, providing video playback, video Publishing, video search</title>
<link>http://www.youku.com</link>
<description>Video service platform, providing video playback, video publishing, video search, video sharing</description>
</image >
<item>
<title>Qianlong and Xiangfei 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 /><itunes:duration>43:42</itunes: duration>
<itunes:keywords>Zunlong, Nurbia, Tianniu, Weng Hong, Ainur, Guhaier, Tan Feiling, Valiyi, Slamjiangsi</itunes:keywords>
<author>Weijie sinks< /author>
<comments>http://www.youku.com/v_show/id_XMTM4NTY5NDk2_rss.html#comments</comments>
<pubDate>Wed, 16 Dec 2009 13:34:06 +0800</pubDate>
<guid>34642374</guid>
<enclosure type=application/x-shockwave-flash url=http://player.youku.com/player.php/sid /34642374/v.swf></enclosure>
</item>
<item>
<title>Qianlong and Xiangfei 02</title>
<link>http://www.youku.com/v_show/id_XMTM4NTY5NTI4_rss.html</link>
<description><![CDATA[<a href=http:// www.youku.com/v_show/id_XMTM4NTY5NTI4_rss.html><img src=http://g2.ykimg.com/0100641F464B178D99EF1F011876CA86F7B34B-B71C-2F1E-36B5-D0804F32AB42 border=0 width=120 height=90 vspace=4 hspace=4 /><itunes:duration>41:26</itunes: duration>
<itunes:keywords>Zunlong, Nurbia, Tianniu, Weng Hong, Ainur, Guhaier, Tan Feiling, Valiyi, Slamjiangsi</itunes:keywords>
<author>Weijie sinks< /author>
<comments>http://www.youku.com/v_show/id_XMTM4NTY5NTI4_rss.html#comments</comments>
<pubDate>Wed, 16 Dec 2009 13:34:06 +0800</pubDate>
<guid>34642382</guid>
<enclosure type=application/x-shockwave-flash url=http://player.youku.com/player.php/sid /34642382/v.swf></enclosure>
</item>
</channel>
</rss>