Home >Backend Development >PHP Tutorial >[救急]问个curl抓取discuzX2的有关问题

[救急]问个curl抓取discuzX2的有关问题

WBOY
WBOYOriginal
2016-06-13 10:21:08759browse

[救急]问个curl抓取discuzX2的问题
目前curl代码:

$url = 'http://www.cf588.com/forum.php?mod=viewthread&tid=145&extra=page%3D1';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, $u);
curl_setopt($ch, CURLOPT_REFERER, $r);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);

每次抓到的东西都是:抱歉,指定的主题不存在或已被删除或正在被审核

用浏览器可以正常打开,用fiddle直接raw:
GET http: //www.cf588.com/forum.php?mod=viewthread&tid=145&extra=page%3D1 HTTP/1.1
Host: www.cf588.com

也能正常获取,郁闷呀,到底那里错了,一点头绪都没有。高手给指点一下呀。

------解决方案--------------------
我这里能找到。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn