How to get data from this ?
1,234,567
I need to get statsTopHi data? but dont know how to do it, i'm new to php and dont know anything about curl.
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, "my url");
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($handle);
curl_close($handle);
$DOM = new DOMDocument;
$DOM->loadHTML($html);
//get all span
$items = $DOM->getElementsByTagName('span');
//display all span text
for ($i = 0; $i < $items->length; $i++)
echo $items->item($i)->nodeValue . "
";
?>
Using this i parse all span content, but need to get only class="statsTopHi"
No comments:
Post a Comment