diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 8606416a9fe..797a1cb9b82 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -182,6 +182,13 @@ Get all the child or parent nodes:: $crawler->filter('body')->children(); $crawler->filter('body > p')->parents(); +Get all the direct child nodes matching a CSS selector:: + + $crawler->filter('body')->children('p.lorem'); + +.. versionadded:: 4.2 + The optional selector in ``children($selector)`` method was introduced in Symfony 4.2. + .. note:: All the traversal methods return a new :class:`Symfony\\Component\\DomCrawler\\Crawler`