我有一个这样的页面 http://abc.php
网友是从百度搜索 国家 我网站排在第三名,
所以网友就进我们网站了
现:我能得到 网友进我们网站的来源页面,
问 如何得到 网友在百度中输入的关键词(国家)呢,
在线等,多谢大家
网友是从百度搜索 国家 我网站排在第三名,
所以网友就进我们网站了
现:我能得到 网友进我们网站的来源页面,
问 如何得到 网友在百度中输入的关键词(国家)呢,
在线等,多谢大家
解决方案 »
- 请教如何创建一个二维数组?
- 谁能告诉我这种JS文件里底部的文件是怎么加密的?怎么解密?
- 求教,为什么wampserver安装目录下的wampmanager.conf没法修改?
- 用php写的简单的文件上传代码,文件不能被上传,错误信息如下,请高手看是什么原因
- 请大家支持一下用zendframework开发的爱唠叨(twitter)
- 请问多表查询SQL出错
- 急!急!急!PHP抓取XML是否只能在Linux下
- 请问怎么通过Curl使用代理获得目标网站的内容?
- 怎么用php连接mssql后,读下一条记录?
- require和include有什么区别阿?
- mb_convert_encoding空格就成了问号
- php snoopy采集遇到的问题 :bad request your browser sent a request that this server could not understand
你能得到上一個頁面的url但是你能得到百度的url???
{
$gather_url="http://www.baidu.com/s?wd=%CF%F3%BA%FE2008&tn=ylmf_3_pg&ch=23";
$has_cn= (preg_match('/baidu.com+/',$gather_url) ?'':'不').'存在';
if($has_cn=='存在')
{
$html = @file_get_contents($gather_url);
$table = preg_replace("'<table[^>]*?>'si","",$html);
$table = preg_replace("'<tr[^>]*?>'si","",$table);
$table = preg_replace("'<td[^>]*?>'si","",$table);
$table = str_replace("</tr>","{tr}",$table);
$table = str_replace("</td>","{td}",$table);
//去掉 HTML 标记
$table = preg_replace("'<[\/\!]*?[^<>]*?>'si","",$table);
//去掉空白字符
$table = preg_replace("'([\r\n])[\s]+'","",$table);
$table = str_replace(" ","",$table);
$table = str_replace(" ","",$table);
if($table)
{
$table = explode('body', $table);
$table = explode('_', $table[0]);
}
echo $table[1];
}
}
gather_key_content();