aardio 官方社区

 找回密码
 注册会员

QQ登录

只需一步,快速开始

搜索
查看: 8887|回复: 4

inet.http获取重定向网页源码时候遇到的一些问题

[复制链接]

22

主题

39

回帖

357

积分

二级会员

积分
357
发表于 2013-2-22 18:55:00 | 显示全部楼层 |阅读模式
inet.http获取网址:http://juqing360.com/test/inetPost.php 的内容,而它使用了重定到百度,并输出了字符串"school",现在我想远程获取这个地址输出的这个单词(school),利用以下方法
不成功,请大家指点:
  1. import inet.http;
  2. http = inet.http();
  3. http.flags = 0x80000000/*_INTERNET_FLAG_RELOAD*/|0x200000/*_INTERNET_FLAG_NO_AUTO_REDIRECT*/; //禁止重定向
  4. url = "http://juqing360.com/test/inetPost.php";
  5. str = http.get(url);
  6. win.msgbox(str);//我想让弹出:school 这个单词
复制代码
远程php代码:
  1. <?php
  2. header("Location:http://www.baidu.com");
  3. echo "school";
  4. ?>
复制代码

22

主题

39

回帖

357

积分

二级会员

积分
357
 楼主| 发表于 2013-2-22 19:08:03 | 显示全部楼层
刚才用php测试了一下可以实现:
1.png
2.png

7

主题

56

回帖

445

积分

二级会员

积分
445
发表于 2013-2-22 20:13:16 | 显示全部楼层
先获取http://juqing360.com/test/inetPost.php
的html源码数据,再查找html里面的chool然后输出

27

主题

648

回帖

4138

积分

超级版主

积分
4138
发表于 2013-2-22 21:23:55 | 显示全部楼层
  1. import inet.whttp;
  2. var http = inet.whttp()
  3. http.disableRedirects()

  4. var str,code,message = http.get("http://juqing360.com/test/inetPost.php")

  5. import console
  6. console.log( str,code,message )
复制代码

22

主题

39

回帖

357

积分

二级会员

积分
357
 楼主| 发表于 2013-2-22 22:30:26 | 显示全部楼层
谢谢
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

手机版|未经许可严禁引用或转载本站文章|aardio.com|aardio 官方社区 ( 皖ICP备09012014号 )

GMT+8, 2025-2-10 18:43 , Processed in 0.058416 second(s), 25 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表