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
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
然后我们先写一个最简单的程序来先,一步一步的来,手把手的教,(呵,废话说多了*.*)
把上面的代码命名为get.asp吧
再一个页面代码就叫getfilename.asp吧.代码如下:
<!--#include file="get.asp"-->
<%
response.write gethttppage("http://www.asp315.com/artical/2/1.htm")
%>
呵,getfilename.asp完成了,当然,这个是最简单的照搬啦,我们要一步一步的来改,来完善,
远行那个当代码,你会看到和那个页面基本上一的页面,当然,有些图片显示不了!
然后我们分析这个页面,首页,点右键,查看源代码找到这一行
<td width="40" height="20" align="center" bgcolor="#F6F6F6">人气</td>
当然,我们不要这么多,光人气二字都可以,但是为了保险,我们还是多要点,
这个是那些文件标题开始的地方,那么我们再找到结束的地方,
<td width="490" align="center">页数
新闻热点
疑难解答
图片精选