function Crawler::parseHtml5
1 call to Crawler::parseHtml5()
- Crawler::parseHtmlString in vendor/
symfony/ dom-crawler/ Crawler.php - Parse string into DOMDocument object using HTML5 parser if the content is HTML5 and the library is available. Use libxml parser otherwise.
File
-
vendor/
symfony/ dom-crawler/ Crawler.php, line 1063
Class
- Crawler
- Crawler eases navigation of a list of \DOMNode objects.
Namespace
Symfony\Component\DomCrawlerCode
private function parseHtml5(string $htmlContent, string $charset = 'UTF-8') : \DOMDocument {
if (!$this->supportsEncoding($charset)) {
$htmlContent = $this->convertToHtmlEntities($htmlContent, $charset);
$charset = 'UTF-8';
}
return $this->html5Parser
->parse($htmlContent, [
'encoding' => $charset,
]);
}