| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
高端软件开发 = 年薪十万不是梦赛孚耐:软件保护加密专家身份认证令牌USB KEY 
共有 278 人关注过本帖
标题:[已解决]我用这个函数获取html代码,为什么采集的页面更新了,我采的代码没更新呢?
收藏  订阅  推荐  打印 
hellode
Rank: 2
等级:注册会员
帖子:132
积分:1462
注册:2007-3-29
[已解决]我用这个函数获取html代码,为什么采集的页面更新了,我采的代码没更新呢?

Function GetURL(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, False
.Send
GetURL = bytes2bstr(.responsebody)
'对取得信息进行验证,如果信息长度小于100则说明截取失败
if len(.responsebody)<100 then
response.write "获取远程文件 <a href="&url&" target=_blank>"&url&"</a> 失败。"
response.end

end if
End With
Set Retrieval = Nothing
End Function
' 二进制转字符串,否则会出现乱码的!
function bytes2bstr(vin)
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin,i,1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin,i+1,1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 1
end if
next
bytes2bstr = strreturn
end functio非n

[ 本帖最后由 hellode 于 2008-8-21 11:38 编辑 ]
搜索更多相关主题的帖子: 函数  html  代码  页面  采集  
2008-8-18 16:59
hellode
Rank: 2
等级:注册会员
帖子:132
积分:1462
注册:2007-3-29

我的意思是说,要被采的页面更新了,而我采下来的却没有更新!

鄂州大学DE校园论坛
2008-8-19 11:37
a89685518
Rank: 1
等级:新手上路
帖子:4
积分:140
注册:2008-7-21
提示: 该帖被管理员或版主屏蔽
2008-8-19 11:57
hellode
Rank: 2
等级:注册会员
帖子:132
积分:1462
注册:2007-3-29

楼上的是垃圾!

鄂州大学DE校园论坛
2008-8-20 10:45
hellode
Rank: 2
等级:注册会员
帖子:132
积分:1462
注册:2007-3-29

自个解决了,因为xmlhttp中,使用,你用同一个网址,他会自动调用以前存起来的html代码

只要在,http://www.hellode.com/BBS/thread-10065-1-1.html这样的后面搞个随机参数就OK,例如:
http://www.hellode.com/BBS/thread-10065-1-1.html?100

鄂州大学DE校园论坛
2008-8-21 10:54
wxr9999
Rank: 1
等级:新手上路
帖子:9
积分:196
注册:2007-2-1

学习了

[url=http://www.code-123.com]网页制作 网页设计[/url]
2008-8-21 18:42
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.051091 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved