@@ -10,10 +10,7 @@ The DomCrawler Component
10
10
.. note ::
11
11
12
12
While possible, the DomCrawler component is not designed for manipulation
13
- of the DOM or re-dumping HTML/XML. However the DomCrawler will attempt to
14
- automatically fix your HTML to match the official specification. Take note
15
- about this behaviour as you could be working with a different DOM after it
16
- has been parsed with the DomCrawler.
13
+ of the DOM or re-dumping HTML/XML.
17
14
18
15
Installation
19
16
------------
@@ -55,6 +52,16 @@ Specialized :class:`Symfony\\Component\\DomCrawler\\Link` and
55
52
:class: `Symfony\\ Component\\ DomCrawler\\ Form ` classes are useful for
56
53
interacting with html links and forms as you traverse through the HTML tree.
57
54
55
+ .. note ::
56
+
57
+ The DomCrawler will attempt to automatically fix your HTML to match the
58
+ official specification. For example, if you nest a ``<p> `` tag inside
59
+ another ``<p> `` tag, it will be moved to be a sibling of the parent tag.
60
+ This is expected and is part of the HTML5 spec. But if you're getting
61
+ unexpected behavior, this could be a cause. And while the ``DomCrawler ``
62
+ isn't meant to dump content, you can see the "fixed" version if your HTML
63
+ by :ref: `dumping it<component-dom-crawler-dumping> `.
64
+
58
65
Node Filtering
59
66
~~~~~~~~~~~~~~
60
67
@@ -187,6 +194,8 @@ and :phpclass:`DOMNode` objects:
187
194
$crawler->addNode($node);
188
195
$crawler->add($document);
189
196
197
+ .. component-dom-crawler-dumping:
198
+
190
199
.. sidebar :: Manipulating and Dumping a ``Crawler``
191
200
192
201
These methods on the ``Crawler `` are intended to initially populate your
0 commit comments