I want to get a DIV from an external website with pure PHP.
External website: http://www.isitdownrightnow.com/youtube.com.html
Div text I want from isitdownr
This may be a little overkill, but you'll get the gist.
preserveWhiteSpace = false;
// Most HTML Developers are chimps and produce invalid markup...
$doc->strictErrorChecking = false;
$doc->recover = true;
$doc->loadHTMLFile('http://www.isitdownrightnow.com/check.php?domain=youtube.com');
$xpath = new DOMXPath($doc);
$query = "//div[@class='statusup']";
$entries = $xpath->query($query);
var_dump($entries->item(0)->textContent);
?>