PHP 卷曲缺少页面内容


Php curl missing content from page

$url = "http://www.ksl.com/index.php?nid=231&sid=74268&cat=&search=&zip=&distance=&min_price=&max_price=&type=&category=&subcat=&sold=&city=&addisplay=%5BNOW-1HOURS+TO+NOW%5D&sort=1&userid=&markettype=sale&adsstate=&nocache=1&o_facetSelected=true&o_facetKey=ad+posted&o_facetVal=Last+Minute&viewSelect=list&viewNumResults=48&sort=1";
$html = file_get_contents($url);

这将返回一些页面内容。我认为因为我尝试卷曲的页面使用jquery来插入 curl 在 jquery 填充页面之前执行的列表?

关于如何获取搜索卷曲的全部内容的任何想法?

试试这个:

 $url = 'http://www.ksl.com/index.php?nid=231&sid=74268&cat=&search=&zip=&distance=&min_price=&max_price=&type=&category=&subcat=&sold=&city=&addisplay=%5BNOW-1HOURS+TO+NOW%5D&sort=1&userid=&markettype=sale&adsstate=&nocache=1&o_facetSelected=true&o_facetKey=ad+posted&o_facetVal=Last+Minute&viewSelect=list&viewNumResults=48&sort=1';

/* gets the data from a URL */
function get_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$returned_content = get_data($url);
echo $returned_content;

不,他们没有通过jQuery,AJAX获取列表。 没有 XHR 请求。

视图源显示列表。

我只是用这段代码来获取

header('Content-Type: text/plain; charset=utf-8');
$url = 'http://www.ksl.com/index.php?nid=231&sid=74268&cat=&search=&zip=&distance=&min_price=&max_price=&type=&category=&subcat=&sold=&city=&addisplay=%5BNOW-1HOURS+TO+NOW%5D&sort=1&userid=&markettype=sale&adsstate=&nocache=1&o_facetSelected=true&o_facetKey=ad+posted&o_facetVal=Last+Minute&viewSelect=list&viewNumResults=48&sort=1';
$data = file_get_contents($url);
echo $data;

结果

部分编辑

Black Xbox 360 320gb Hard Drive Plus controllers and G...</a>
<span style="color: #555;">Magna,&nbsp;UT
&nbsp;|&nbsp; 1 Min
<div class="adDesc">
Selling because I got it used then only used it once, works fantastically and comes with lots of games plus 4 controllers and a keyboard for the contr&nbsp;
<a class="listlink" href="?nid=218&ad=34170943&cat=&lpid=&search=&ad_cid=7">more...</a>
<div class="priceBox">
<a href="?nid=218&ad=34170943&cat=&lpid=&search=&ad_cid=7">
<span >$450<span class="priceCents">00
<!-- <div class="adDays">1 Min -->
<!--<div class="adTime">Dec 31, 1969-->
<div class="detailBox">
Great PS4 Bundle</a>
<span style="color: #555;">Spanish Fork,&nbsp;UT
&nbsp;|&nbsp; 1 Min
Have here a great PS4 bundle with 6Games 1controller and 3months of PS Network. Still has the box. Text 801-633-1659&nbsp;
<span >$400<span class="priceCents">00
相关文章:
  • 没有找到相关文章