我采集一个页面后在换一个地址去抓取 还是上次的数据 到底数据保存在哪里 如何清空啊
解决方案 »
- Notice: Use of undefined constant charset - assumed 'charset' in on line 9
- post参数的值为一段路径,传到后端时反斜杠都被过滤掉,这个问题怎么解决?
- 这里有谁用phpmyadmin的吗
- 怎样使用JPgraph将生成的图片保存为jpg或png文件?
- 表达式取值问题
- 相当与ASP中的函数clnt,clng
- 版主大大的不用递归《读取树状数据的方法》有bug,修改版
- PHP查询结果 标题的参数不显示,可能是调用出错了
- 菜鸟求救!谢谢!
- 读取数据库中的数据转JSON串 为什么
- php如何判断第一次登录后台管理
- 使用file_get_html()函数,需要加载什么吗?
// create a new curl resource
//$ch = curl_init();// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.dygod.com/html/tv/hepai/guochan/20100104/23808.html");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_HEADER, 0);// grab URL and pass it to the browser$str=curl_exec($ch);
curl_close($ch);
$reg="/<div class=\"title_all\"><h1><font color=#008800>(.+?)<\/font><\/h1><\/div>/";
preg_match_all($reg,$str,$title);
echo iconv('gb2312','utf-8',$title[1][0]);$reg="/<!--Content Start-->(.+)<br><center><\/center>/s";
preg_match_all($reg,$str,$info);
echo iconv('gb2312','utf-8',$info[1][0]);
?>
给上代码
有个问题需要你确认下, 你确定URI的 内容会发生变化么
如果你一直在抓一个静态页面,我想没有太大的意义.