有个php网页内容抓取的问题,就是说我想抓取某个网站的部分内容,代码该怎么写:比如:我想抓取http://www.jf317.com首页中的 《最新更新》版块中的内容,php方法该怎么写
急求

解决方案 »

  1.   

    file_get_contents
    curl
    fopen
    等等……
      

  2.   

    像这样的方法:<?
    if ($stream = fopen('http://www.jf317.com', 'r')) {
        // print all the page starting at the offset 10
        echo stream_get_contents($stream,-1,10);
        fclose($stream);
    }if ($stream = fopen('http://www.jf317.com', 'r')) {
        // print the first 5 bytes
        echo stream_get_contents($stream, 5);
        fclose($stream);
    }
    ?>我该怎样才获取到《最新更新》版块中的内容,就是单单要最新更新里面的内容,其它的都不要
    各位大侠出来说说吧,在线等了
      

  3.   

    推荐用file_get_contents,然后用正则过滤出你要的内容!