本帖最后由 sky8 于 2010-08-13 14:29:39 编辑

解决方案 »

  1.   

    <meta http-equiv="refresh" content="0; url=http://www.3Gabc.com">3gabc.com就只有这么一句。
    你也只能获取到这个,meta  refresh是在浏览器上执行的!!!
      

  2.   

    我的意思啊,怎么判断网站header头,并根据location等信息,自动转向,抓取最终页面代码。。
      

  3.   

    可以试下抓取:www.ttdhappy.com 我是抓不到了。。
      

  4.   

    因为3gabc.com就只有这么一句。<meta http-equiv="refresh" content="0; url=http://www.3Gabc.com">你在抓取页面后 “echo $contents;” 页面自然就重定向到http://www.3Gabc.com 了。
    所以不能echo $contents; 而是用正则“preg_match("/<meta\s*http-equiv=\"refresh\"\s*content=\"0;\s*url=(.*?)\">/is",$content, $matches)”
    抓出转向地址,然后在curl这个转线地址,就可以抓到你要的内容了。
      

  5.   

    使用curl请求的页面返回的结果中包含<meta http-equiv="refresh" content="0; url=http://www.3Gabc.com">, curl的变量CURLOPT_FOLLOWLOCATION设为true, 但是不会重定向的。
    请问这个问题怎么解决啊。。