Home > Backend Development > PHP Tutorial > 发现云云的网页不能抓取,有什么方法破解吗??

发现云云的网页不能抓取,有什么方法破解吗??

WBOY
Release: 2016-06-23 14:19:34
Original
954 people have browsed it

echo file_get_contents("http://weibo.yunyun.com/Weibo.php?q=%E7%A8%8B%E5%BA%8F%E5%91%98#p=1&q=%E7%A8%8B%E5%BA%8F%E5%91%98");


会要求输入验证码。



我用了curl伪造来源地址和ip,一样不能抓取,有什么方法可以破解??


回复讨论(解决方案)

没人知道吗???

高手都去哪里了??

用curl可以抓取啊

 $ch = curl_init();// 设置URL和相应的选项curl_setopt($ch, CURLOPT_URL, "http://weibo.yunyun.com/Weibo.php?p=1&q=%E7%A8%8B%E5%BA%8F%E5%91%98");curl_setopt($ch, CURLOPT_HEADER, 0);// 抓取URL并把它传递给浏览器curl_exec($ch);// 关闭cURL资源,并且释放系统资源curl_close($ch);
Copy after login

怎么我这里不行的??

<?phpecho "aa"; $ch = curl_init(); // 设置URL和相应的选项curl_setopt($ch, CURLOPT_URL, "http://weibo.yunyun.com/Weibo.php?p=1&q=%E7%A8%8B%E5%BA%8F%E5%91%98");curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //不能获取,会跳转到输入验证码的页面 // 抓取URL并把它传递给浏览器curl_exec($ch); // 关闭cURL资源,并且释放系统资源curl_close($ch);?>
Copy after login

3楼的,我发现本地可以正常获取,在服务器上不能正常获取。

是不是你们的服务器不连外网

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template