php 模仿百度蜘蛛采取网页信息
来源:互联网 发布:苹果预约软件 编辑:程序博客网 时间:2024/05/18 14:44
function vspider_get($url){
$ch2 = curl_init();
$user_agent = "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)";//这里模拟的是百度蜘蛛
curl_setopt($ch2, CURLOPT_URL, $url);
curl_setopt($ch2, CURLOPT_HEADER, false);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_REFERER, 'www.baidu.com');//1这里写一个来源地址,可以写要抓的页面的首页
curl_setopt($ch2, CURLOPT_USERAGENT, $user_agent);
$temp=curl_exec($ch2);
return $temp;
}
$url="www.baidu.com";//2要抓取的地址
$ch2 = curl_init();
$user_agent = "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)";//这里模拟的是百度蜘蛛
curl_setopt($ch2, CURLOPT_URL, $url);
curl_setopt($ch2, CURLOPT_HEADER, false);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_REFERER, 'www.baidu.com');//1这里写一个来源地址,可以写要抓的页面的首页
curl_setopt($ch2, CURLOPT_USERAGENT, $user_agent);
$temp=curl_exec($ch2);
return $temp;
}
$url="www.baidu.com";//2要抓取的地址
$contents=vspider_get($url);
var_dump($contents);
0 0
- php 模仿百度蜘蛛采取网页信息
- 如何吸引百度蜘蛛天天刷网页
- 百度蜘蛛喜欢的 网页 seo
- php 模仿蜘蛛抓取内容并分析
- php 抓取网页信息
- 抓取网页信息PHP
- python 网络爬虫与信息采取之解析网页(一)--BeautifulSoup库
- python网络爬虫与信息采取之解析网页实例---oJ期末成绩排名
- 网页模仿
- 百度蜘蛛观察
- 百度蜘蛛什么时候出来
- 勾引百度,引诱蜘蛛
- 关于百度蜘蛛(Baiduspider)
- 吸引百度蜘蛛
- 关于百度蜘蛛ip
- 百度蜘蛛IP分析
- 【SEO名词解释】百度蜘蛛
- 百度蜘蛛模拟
- GDB的使用以及使用gdb来调试caffe代码
- return、exit和_exit的区别+atexit
- HDU 5194 DZY Loves Balls (组合数学)
- Java8移除永久代
- Android: Sqlite基本操作
- php 模仿百度蜘蛛采取网页信息
- 冒泡排序
- OpenStack Python知识(1):with函数使用
- 不同的路径
- 范型程序设计——洗牌
- Web Service是什么-作者: 阮一峰
- 大、小根堆
- 垃圾收集算法
- Python爬虫第一步之获取网页源代码