@@ -201,8 +201,16 @@ Access the node name (HTML tag name) of the first node of the current selection
201201
202202Access the value of the first node of the current selection::
203203
204+ // if the node does not exist, calling to text() will result in an exception
204205 $message = $crawler->filterXPath('//body/p')->text();
205206
207+ // avoid the exception passing an argument that text() returns when node does not exist
208+ $message = $crawler->filterXPath('//body/p')->text('Default text content');
209+
210+ ..versionadded ::4.3
211+
212+ The default argument of ``text() `` was introduced in Symfony 4.3.
213+
206214Access the attribute value of the first node of the current selection::
207215
208216 $class = $crawler->filterXPath('//body/p')->attr('class');
@@ -298,8 +306,16 @@ and :phpclass:`DOMNode` objects::
298306 Or you can get the HTML of the first node using
299307:method: `Symfony\\ Component\\ DomCrawler\\ Crawler::html `::
300308
309+ // if the node does not exist, calling to html() will result in an exception
301310 $html = $crawler->html();
302311
312+ // avoid the exception passing an argument that html() returns when node does not exist
313+ $html = $crawler->html('Default <strong>HTML</strong> content');
314+
315+ ..versionadded ::4.3
316+
317+ The default argument of ``html() `` was introduced in Symfony 4.3.
318+
303319Expression Evaluation
304320~~~~~~~~~~~~~~~~~~~~~
305321