基本都是用XML抓取网页,然后过虑内容。有选择的存入数据库.....

解决方案 »

  1.   

    楼主需要的是这个吧!<script language="JavaScript1.1">
    <?php 
    $content = file("http://app0.china.com/freecode/out.php?typeid=1000&num=9&t=否");
    $content = implode("\n", $content);
    $content = str_replace("<br/>", "", $content);
    $content = str_replace("</a>", "</a><br/>", $content);
    $content = str_replace("&nbsp;&nbsp;<a href='http://news.china.com/zh_cn/international/index.html' target='_blank'>……更多内容</a><br/>", "", $content);
    echo($content."\n");
    ?>
    </script>
      

  2.   

    你可以在服务器端使用XMLHTTP抓取别人网站上的信息,你可以参考一下“新闻小偷”之类的程序
      

  3.   

    是不是可以用FILE_GET_CONTENT抓取页面,然后做分析?有没有要注意的地方?
      

  4.   

    楼主说的极是~~如果空间支持php建议用php还抓取,这样就可以隐藏原来的网址了如果用xmlhttp抓取,客户端可以查看到源码的,不具备隐憋性`````````关键要运用好正则表达式!~~~~~~~
      

  5.   

    <?php
    set_time_limit(0);define('ROOT', dirname(__FILE__)."/");for($i = 10000; $i < 100000; $i++)
    {
      print("$i\n");
      if (!file_exists(ROOT."$i.html"))
      {
        $string = file_get_contents("http://www.abc.com/$i.html");
        if (!empty($string))
        {
          $file = fopen(ROOT."$i.html", "wb");
          if (False != $file)
          {
            fwrite($file, $string);
            fclose($file);
          }
        }
      }
    }
    ?>
    像这样?你还可以用eregi来对HTML进一步分析~~参考手册“章 19. 使用远程文件”的部分