Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -659,27 +659,8 @@ another given base URI::
UriResolver::resolve('?a=b', 'http://localhost/bar#foo'); // http://localhost/bar?a=b
UriResolver::resolve('../../', 'http://localhost/'); // http://localhost/

Using a HTML5 Parser
~~~~~~~~~~~~~~~~~~~~

If you need the :class:`Symfony\\Component\\DomCrawler\\Crawler` to use an HTML5
parser, set its ``useHtml5Parser`` constructor argument to ``true``::

use Symfony\Component\DomCrawler\Crawler;

$crawler = new Crawler(null, $uri, useHtml5Parser: true);

By doing so, the crawler will use the HTML5 parser provided by the `masterminds/html5`_
library to parse the documents.

.. versionadded:: 6.3

The ``useHtml5Parser`` argument was introduced in Symfony 6.3.

Learn more
----------

* :doc:`/testing`
* :doc:`/components/css_selector`

.. _`masterminds/html5`: https://packagist.org/packages/masterminds/html5