I have a bit of php that grabs the html from a page and loads it into a simplexml object. However its not getting the classes of the element within a
The php
//load the html page with curl
$html = curl_exec($ch);
curl_close($ch);
$doc = new DOMDocument();
$doc->loadHTML($html);
$sxml = simplexml_import_dom($doc);
The page html. Which if I do a var_dump of $html shows its been scraped and exists in $html
<li class="large">
<a style="" id="ref_3" class="off" href="#" onmouseover="highlightme('07');return false;" onclick="req('379');return false;" title="">07</a>
</li>
The var_dump (below) of $doc and $sxml show that the a class of 'off' is now missing. Unfortunately I need to process the page based on this class.
[8]=>
object(SimpleXMLElement)#50 (2) {
["@attributes"]=>
array(1) {
["class"]=>
string(16) "large"
}
["a"]=>
string(2) "08"
}