问题描述
我一直在尝试通过Curl抓取一个页面,但是没有正确地做,因为页面返回的编码不好。以下是此网页:请告诉我怎么做的帮助PHP的curl,使我可以正确地查看它。任何帮助将不胜感激。提前感谢!
I've been trying to grab one page via Curl but fail to do it properly as the page is returned badly encoded. Here's the page: http://www.movinsane.com/play13.php?vid=107628 Would you please tell me what how to do it with the help of PHP's Curl so that I can view it properly. Any help would be much appreciated. Thanks in advance!
$c = curl_init('http://www.movinsane.com/play13.php?vid=108561');
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($c, CURLOPT_ENCODING, "gzip");
$sourse = curl_exec($c);
curl_close($c);
echo $sourse;
推荐答案
这不是一个curl相关的问题。它正确下载内容。您必须在写出 $ sourse之前加入
< base href =http://www.movinsane.com//>
This is not a curl related problem. It downloads the content properly. You have to include a <base href="http://www.movinsane.com/"/>
before writing out the $sourse
.
我认为这些类型的动作是网络钓鱼。
My opinion is that these type of actions are phishings.
这篇关于Curl无法正确获取网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!