function Crawler::parseHtmlString
Parse string into DOMDocument object using HTML5 parser if the content is HTML5 and the library is available. Use libxml parser otherwise.
1 call to Crawler::parseHtmlString()
- Crawler::addHtmlContent in vendor/
symfony/ dom-crawler/ Crawler.php - Adds an HTML content to the list of nodes.
File
-
vendor/
symfony/ dom-crawler/ Crawler.php, line 1204
Class
- Crawler
- Crawler eases navigation of a list of \DOMNode objects.
Namespace
Symfony\Component\DomCrawlerCode
private function parseHtmlString(string $content, string $charset) : \DOMDocument {
if ($this->canParseHtml5String($content)) {
return $this->parseHtml5($content, $charset);
}
return $this->parseXhtml($content, $charset);
}