I'm attempting to get the DOM elements of external pages. Based on other posts I'm trying:
$html = htmlentities(file_get_contents('http://www.slate.com'));
$dom = new domDocument;
$dom->loadHTML($html);
echo "<pre>";
var_dump($dom);
echo "</pre>";
(Html entites kills warnings, but otherwise has the same result as leaving it out).
Based on what I've read, this should return various DOM parts in parent/child nodes. But the result of the code above contains no DOM nodes, just a huge "textContent" element that contains the entire page HTML.
Thanks in advance for thoughts on what I'm doing wrong.