File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ The DomCrawler Component
7
7
8
8
The DomCrawler Component eases DOM navigation for HTML and XML documents.
9
9
10
+ .. note ::
11
+
12
+ While possible, the DomCrawler is not designed for manipulation of the
13
+ DOM or re-dumping HTML/XML.
14
+
10
15
Installation
11
16
------------
12
17
@@ -172,6 +177,22 @@ and :phpclass:`DOMNode` objects:
172
177
$crawler->addNode($node);
173
178
$crawler->add($document);
174
179
180
+ .. note ::
181
+
182
+ These methods on the ``Crawler `` are intended to initially populate your
183
+ ``Crawler `` and aren't intended to be used to further manipulate a DOM
184
+ (though this is possible). However, since the ``Crawler `` is a set of
185
+ :phpclass: `DOMElement ` objects, you can use any method or property available
186
+ on :phpclass: `DOMElement `, :phpclass: `DOMNode ` or :phpclass: `DOMDocument `.
187
+ For example, you could get the HTML of a ``Crawler `` with something like
188
+ this::
189
+
190
+ $html = '';
191
+
192
+ foreach ($crawler as $domElement) {
193
+ $html.= $domElement->ownerDocument->saveHTML();
194
+ }
195
+
175
196
Form and Link support
176
197
~~~~~~~~~~~~~~~~~~~~~
177
198
You can’t perform that action at this time.
0 commit comments