使用 LoadVars 加载 cbsnews.com 有时会返回 GIF89a

发布于 2024-07-29 05:25:52 字数 430 浏览 3 评论 0原文

由于某种原因,当我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

執念 2024-08-05 05:25:52

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文