基本都是用XML抓取网页,然后过虑内容。有选择的存入数据库.....
解决方案 »
- 调用date("1")函数,页面显示500 - Internal Server Error是怎么回事
- 散分:请帮忙将此段代码转成PHP,急啊~~~
- 用Snoopy或者fsockopen post方法提交参数
- 一个关于innerhtml select的问题
- 菜鸟求助:我有一个20G的空间,想在这个IP地址上挂几个不同内容的网站要怎么弄?
- 如何把 iframe 中编辑的内容传递到下一页
- 有段时间没来这里了,发生了很多事啊,网站也被黑了,咳......
- 江湖求救贴!分不够再加!
- 用main()可以直接的发送邮件吗?
- php webservice错误
- 关于用表格发送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. 使用远程文件”的部分