lundi 2 février 2015

scrap data from buybuybaby.com


I need to fetch price of product on page: http://ift.tt/168C8Bq


I have tried loadHTMLFile, file_get_contents and cURL, but not able to fetch the price. Please some one help me.



<?php
/*
$doc = new DOMDocument;
$doc->loadHTMLFile( 'http://ift.tt/168C8Bq');
echo $doc->saveHTML( $doc);

$feed = file_get_contents( 'http://ift.tt/168C8Bq');
echo $items = simplexml_load_string($feed);
*/
$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,"http://ift.tt/168C8Bq");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);

$output = curl_exec($ch);

curl_close($ch);

$items = simplexml_load_string($output);
?>




Aucun commentaire:

Enregistrer un commentaire