使用 LoadVars 加载 cbsnews.com 有时会返回 GIF89a
由于某种原因,当我在 actionscript 2 中使用 LoadVars 加载 cbsnews.com 时,我有时会正确获取该页面的 html,有时会得到 GIF89a
。 我不确定这意味着什么,因此任何帮助或建议将不胜感激。 这里有一些示例代码供您自行测试。
var foo:LoadVars = new LoadVars();
foo.onData = function(bar) {
trace(bar);
}
foo.load("http://www.cbsnews.com/");
编辑:我尝试遵循 Chris Shaffer 的建议,但似乎没有简单的方法将响应写入 Flash 中的 gif 文件。 我觉得这很奇怪,所以我会继续寻找一种将响应写入 gif 文件的方法,但如果有人知道如何操作或有其他建议,请告诉我。
For some reason when I use LoadVars in actionscript 2 to load cbsnews.com, I sometimes properly get the html for the page and other times I get GIF89a
. I'm not sure what this means, so any help or suggestions would be appreciated. Here is some sample code to test it yourself.
var foo:LoadVars = new LoadVars();
foo.onData = function(bar) {
trace(bar);
}
foo.load("http://www.cbsnews.com/");
Edit: I tried to follow the advice of Chris Shaffer, but it seems that there is no simple way of writing response into a gif file in flash. I feel like this is strange so I'll keep looking for a way to write the response into a gif file, but if anyone knows how or has another suggestion please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GIF89a 是 .gif 文件的前几个字节; 我只是猜测,但也许 CBS 对您在特定时间段内可以发出的请求数量有限制,之后他们会提供图像(以阻止屏幕抓取和/或非法使用该网站)。
这只是一个猜测; 有没有办法可以发出请求并将完整响应保存到文件中,以便您可以在返回时查看 .gif?
GIF89a is the first several bytes of a .gif file; I'm just guessing, but perhaps CBS has limits on the number of requests you can make in a particular period of time, after which they serve up an image (to stop screen scraping and/or illegitimate use of the site).
It's just a guess; Is there a way you can make the request and save the full response to a file, so you could then view the .gif when it is returned?