关于页面信息截取的问题!

happynet 2006-11-13 02:32:07
Function Gethttppage(Path)
T = Getbody(Path)
Gethttppage=Bytestobstr(T,"Gb2312")
End Function
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
Wstr=Gethttppage("http://www.hqew.com/Homepage/yg2002/ICStock.asp?SiteID=591&keyword=++")

我这样获取得到的页面内容与直接打开的内容不一样,有什么解决的办法?
...全文
95 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yyjzsl 2006-11-14
  • 打赏
  • 举报
回复
楼上的,我也试过了,可以啊!
chaoliu1 2006-11-13
  • 打赏
  • 举报
回复
可以了啊,我已经运行过了,这样改:

在程序结尾加上这一段,网站内容就被读到Wstr中并显示了出来


response.write Wstr

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
happynet 2006-11-13
  • 打赏
  • 举报
回复
还是不行呀!各位高人.有啥办法解决问题?谢谢
仙人掌 2006-11-13
  • 打赏
  • 举报
回复
With Retrieval
.SetRequestHeader("referer",value)
.Open "Get", Url, False, "", ""
.Send
happynet 2006-11-13
  • 打赏
  • 举报
回复
huo789(四火) 改了,不行.获取不到内容!

yeefly(topn.net)(困在SH)
这句话加在那里呢?
仙人掌 2006-11-13
  • 打赏
  • 举报
回复
可能是目标网站判断了请求来源 而做出不同输出

试试 使用SetRequestHeader("referer",value)
huo789 2006-11-13
  • 打赏
  • 举报
回复
Responsebody改为ResponseText试试

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧