We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 561c6ee commit 09c9af4Copy full SHA for 09c9af4
components/dom_crawler.rst
@@ -193,6 +193,15 @@ Get all the child or parent nodes::
193
Accessing Node Values
194
~~~~~~~~~~~~~~~~~~~~~
195
196
+.. versionadded:: 2.6
197
+ The :method:`Symfony\\Component\\DomCrawler\\Crawler::nodeName`
198
+ method was introduced in Symfony 2.6.
199
+
200
+Access the node name (HTML tag name) of the first node of the current selection (eg. "p" or "div")::
201
202
+ // will return the node name (HTML tag name) of the first child element under <body>
203
+ $tag = $crawler->filterXPath('//body/*')->nodeName();
204
205
Access the value of the first node of the current selection::
206
207
$message = $crawler->filterXPath('//body/p')->text();
0 commit comments