小弟最近搞一网站内容获取程序,使用的是IdHTTP组件。使用Visual Sniffer截取数据包查看发现该网站post后会发回两段数据包,分别是:
?HTTP/1.1 200 OK?HTTP/1.1 200 OK
Date: Wed, 02 Jul 2008 07:14:10 GMT
Server: Apache/1.3.33 (Unix) Resin/2.1.16
Content-Length: 30
Connection: close
Content-Type: text/html;charset=GBK<script>var p=parent;</script>
=====================================================

==============================================
<script>p.addRM("<div class='comeDesc'><u onclick=\"p.talkTo('232055093','致命口味');\" style='cursor:hand'>致命口味</u>从<u onclick=\"cmd('go '+this.innerHTML);\" style='cursor:hand'>西门</u>走了过来</div>");</script>
。。
一堆script函数
==========================================
现在问题是idhttp1.Post方法返回值只是只有<script>var p=parent;</script>这一点,而获取不到第二段数据,诸位高手有没有遇到过这个问题,小弟求解?

解决方案 »

  1.   

    可能是我表述错了,我想取得第一段的内容,结果取得了第二段的,也就是说现在第二段的把第一段的内容给覆盖了
    idhtp1.Post('http://x3.maoyou.xiaonei.com/action.jsp',ioption, LResponse);
    返回的LResponse只有后一段的数据,我想取第一段的。