可以调用对方的页面,查看对方页面的htm内容,用php把你需要的部分截取下来,在你的页面上显示。相当于网上的新闻小偷那样的作法。

解决方案 »

  1.   

    使用Socket发出post并接收,自行分析返回结果到页面
      

  2.   

    这样试试:
    提交到=>他的页面
    他的页面返回结果=>接收结果页面
    分析为你所用
      

  3.   

    Socket
    例子 2. Socket example: Simple TCP/IP clientThis example shows a simple, one-shot HTTP client. It simply connects to a page, submits a HEAD request, echoes the reply, and exits. <?php
    error_reporting (E_ALL);echo "<h2>TCP/IP Connection</h2>\n";/* Get the port for the WWW service. */
    $service_port = getservbyname ('www', 'tcp');/* Get the IP address for the target host. */
    $address = gethostbyname ('www.example.com');/* Create a TCP/IP socket. */
    $socket = socket_create (AF_INET, SOCK_STREAM, 0);
    if ($socket < 0) {
        echo "socket_create() failed: reason: " . socket_strerror ($socket) . "\n";
    } else {
        echo "OK.\n";
    }echo "Attempting to connect to '$address' on port '$service_port'...";
    $result = socket_connect ($socket, $address, $service_port);
    if ($result < 0) {
        echo "socket_connect() failed.\nReason: ($result) " . socket_strerror($result) . "\n";
    } else {
        echo "OK.\n";
    }$in = "HEAD / HTTP/1.0\r\n\r\n";
    $out = '';echo "Sending HTTP HEAD request...";
    socket_write ($socket, $in, strlen ($in));
    echo "OK.\n";echo "Reading response:\n\n";
    while ($out = socket_read ($socket, 2048)) {
        echo $out;
    }echo "Closing socket...";
    socket_close ($socket);
    echo "OK.\n\n";
    ?>
     
      

  4.   

    218.62.38.187/tian/index.php?id=600643
    我这是从yahoo里抓取动态股票行情的,你可以更换id变量,抓的是不同的股票信息
    你也可以使用这种原理,从网上一个专门提供工商名称的网站里抓取信息
    下面是代码
    <?php
        $data="http://cn.finance.yahoo.com/q?m=c&s=".$_GET["id"]."&d=v1";   
        
        $fp= @fopen($data,"r") or die("无法取得远程数据");                      
        while(!feof($fp)){
         $all.= @fgets($fp,1024);
        }
        @fclose($fp);                                                                
        
        $start=strpos($all,"<tr align=right>");
        $end=strpos($all,"</table></td></tr><tr><td><small>");                                      
       $all=substr($all,$start,$end-$start);
        $all=str_replace("\r\n","",$all);  
    $all=str_replace("\n","",$all); 
    $all=str_replace(" nowrap align=left","",$all); 
    $all=str_replace(" nowrap align=center","",$all); 
    $all=str_replace(" nowrap","",$all);               
         preg_match_all("|<td>(.*)</td>|U",$all,$info);        
    for($i=1;$i<7;$i++)
    {
     $info[0][$i]=str_replace("<td>","",$info[0][$i]); 
     $info[0][$i]=str_replace("</td>","",$info[0][$i]); 
    echo $info[0][$i]."<br>";
    }
                                                              
    ?>
      

  5.   

    http://expert.csdn.net/Expert/topic/2213/2213914.xml?temp=.1852381
      

  6.   

    还是不行,我现在要访问的地址http://pol.royalmail.com/dda/AF.asp
    在postcode中输入Y021 3VB你就可以得到对应的地址,
    现在我用了上面的程序,还是没有返回,
    是不是我哪里搞错了,HELP ME
    :) 高分相增