通过curl加载完整文档

时间:2014-12-04 11:47:16

标签: php html curl

您好我有通过curl加载页面的问题。页面html看起来像这样

<!--showModel--><!DOCTYPE html>
<html>
<head>
...

然后卷曲加载页面我只得到

<!--showModel-->

如何加载整页?

php代码看起来像这样

$agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

0 个答案:

没有答案