File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -651,8 +651,28 @@ another given base URI::
651651 UriResolver::resolve('?a=b', 'http://localhost/bar#foo'); // http://localhost/bar?a=b
652652 UriResolver::resolve('../../', 'http://localhost/'); // http://localhost/
653653
654+ Using a HTML5 Parser
655+ ~~~~~~~~~~~~~~~~~~~~
656+
657+ You can specify to the :class: `Symfony\\ Component\\ DomCrawler\\ Crawler ` to use
658+ an HTML5 parser when instantiating it by setting the ``useHtml5Parser `` constructor
659+ argument to ``true ``::
660+
661+ use Symfony\Component\DomCrawler\Crawler;
662+
663+ $crawler = new Crawler(null, $uri, useHtml5Parser: true);
664+
665+ By doing do, the crawler will use the parser from the `masterminds/html5 `_ library internally to parse
666+ documents.
667+
668+ .. versionadded :: 6.3
669+
670+ The ``useHtml5Parser `` argument was introduced in Symfony 6.3.
671+
654672Learn more
655673----------
656674
657675* :doc: `/testing `
658676* :doc: `/components/css_selector `
677+
678+ .. _`masterminds/html5` : https://packagist.org/packages/masterminds/html5
You can’t perform that action at this time.
0 commit comments