preserveWhiteSpace = false; // Most HTML Developers are chimps and produce invalid markup... $doc->strictErrorChecking = false; $doc->recover = true; $doc->loadHTMLFile('https://pengenyt.dk'); $xpath = new DOMXPath($doc); $query = "//div[@class='magazines]"; $entries = $xpath->query($query); var_dump($entries->item(0)->textContent); ?>