<?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
这种,就采不了,他跳到登录界面,请问各位高手是我怎么才能实现自动登录,或者跳过看,采集到他的粉丝人数~十分感谢!

解决方案 »

  1.   

    用curl 可模拟登陆
    http://developer.51cto.com/art/200904/121739.htm
      

  2.   

    可以用CURL做一个代理进行登陆后,就能访问非名人的微博了。
      

  3.   

    可以参考此文进行curl模拟登录
    http://blog.csdn.net/hudie631489527/archive/2010/10/05/5922097.aspx
      

  4.   

    CURL
      

  5.   

    不有API么?
      

  6.   

    用 php中的curl  你去查查看吧
      

  7.   

    使用snoopy.class.php吧
      

  8.   

    need sine API 4 reading the data value form that F**K t.sina.com.cn
      

  9.   

    应该有api的。直接用api不更省事?
      

  10.   

    前几个月做了个,有现成的API 不用, 为什么还要去采集?