问一个时髦问题,关于信息抓取?老大们来。 基本都是用XML抓取网页,然后过虑内容。有选择的存入数据库..... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼主需要的是这个吧!<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(" <a href='http://news.china.com/zh_cn/international/index.html' target='_blank'>……更多内容</a><br/>", "", $content);echo($content."\n");?></script> 你可以在服务器端使用XMLHTTP抓取别人网站上的信息,你可以参考一下“新闻小偷”之类的程序 是不是可以用FILE_GET_CONTENT抓取页面,然后做分析?有没有要注意的地方? 楼主说的极是~~如果空间支持php建议用php还抓取,这样就可以隐藏原来的网址了如果用xmlhttp抓取,客户端可以查看到源码的,不具备隐憋性`````````关键要运用好正则表达式!~~~~~~~ <?phpset_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. 使用远程文件”的部分 如何在页面中显示出调用数据库信息? 写了注册页面但是登录失败 用PHP开发的WAP网站 跳转问题 Eclipse下php保存后没有实时的预览 做不出来,一道难题困了我一天了 用PHP实现文件上传(详解) 请推荐一个影视下载的系统 现有短信网站可能出现的BUG? fopen用a+打开一个文件,然后想把文件内容清空,该怎么做?{在线等待!} sfs 关于用表格发送Email的问题!!! PHP的页面布局用什么设计
<?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(" <a href='http://news.china.com/zh_cn/international/index.html' target='_blank'>……更多内容</a><br/>", "", $content);
echo($content."\n");
?>
</script>
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. 使用远程文件”的部分