function parseDocument() {
        $this->prepareHtml();

        $current = libxml_use_internal_errors(true);
        $disableEntities = libxml_disable_entity_loader(true);

        $charset = 'UTF-8';
        $this->doc = new \DOMDocument('1.0', $charset);
        $this->doc->strictErrorChecking = false;

        @$this->doc->loadHTML($this->html);

        libxml_use_internal_errors($current);
        libxml_disable_entity_loader($disableEntities);
    }