public function __construct($html) { $this->dom = new \DOMDocument(); libxml_use_internal_errors(true); $this->dom->loadHTML($html); $this->xp = new \DOMXPath($this->dom); }