<?php
if(@$_POST['button']!=""){
$content=$_POST['content'];$url="$content";
@$fp=fopen($url,"r") or die("输入有误,输入格式如:http://t.sina.com.cn/caiwensheng");
$fcontents=file_get_contents($url);
@eregi("</span><span><em class=\"MIB_txtal\">(.*)</em>粉丝</span><span>",$fcontents,$rg);//截取内容
//$rg[1]=str_replace("src=\"../images/","src=\" http://tq121.weather.com.cn/images/",$rg[1]);
echo $rg[1];
echo $rg1[1];
if($rg[1]==false){
echo "<script>window.location.href='http://t.sina.com.cn/'</script>";
}
}
?>
我想采集微博的粉丝人数,如果那个是名人,经过认真的,就可采集,不过没经认证的,如http://t.sina.com.cn/yjanb11
这种,就采不了,他跳到登录界面,请问各位高手是我怎么才能实现自动登录,或者跳过看,采集到他的粉丝人数~十分感谢!
if(@$_POST['button']!=""){
$content=$_POST['content'];$url="$content";
@$fp=fopen($url,"r") or die("输入有误,输入格式如:http://t.sina.com.cn/caiwensheng");
$fcontents=file_get_contents($url);
@eregi("</span><span><em class=\"MIB_txtal\">(.*)</em>粉丝</span><span>",$fcontents,$rg);//截取内容
//$rg[1]=str_replace("src=\"../images/","src=\" http://tq121.weather.com.cn/images/",$rg[1]);
echo $rg[1];
echo $rg1[1];
if($rg[1]==false){
echo "<script>window.location.href='http://t.sina.com.cn/'</script>";
}
}
?>
我想采集微博的粉丝人数,如果那个是名人,经过认真的,就可采集,不过没经认证的,如http://t.sina.com.cn/yjanb11
这种,就采不了,他跳到登录界面,请问各位高手是我怎么才能实现自动登录,或者跳过看,采集到他的粉丝人数~十分感谢!
解决方案 »
- 可以分国家/地区统计网站流量
- 谁知道destoon这个电子商务系统里在线编辑器如何删除垃圾图片的
- 一个dotProject登录的问题 急急急 在线等
- redhat6.0自带的apache怎样运行php5?是否还用加载php5模块?
- Windows服务器怎么是用的什么ftp 还是serveru吗?跑php怎么配页面缓存,是squid还是nginx?
- dompdf怎么显示中文呢?
- 收集了点php的电子书,有兴趣的去下载
- 我的PHPBB3安装最后一步,提示权限错误,可我用的Root用户啊!
- ioncube encoder 或 zend encoder的版本兼容问题
- 二维数组排序大家怎么做
- 数据采集 亚马逊 书
- discuz7.2怎么才能显示回复最多的前十个帖子
http://developer.51cto.com/art/200904/121739.htm
http://blog.csdn.net/hudie631489527/archive/2010/10/05/5922097.aspx