2

I have a question about the dom crawler, or more specifically, the CssSelector Component. When I run

$descendants = $crawler->filter('ul > li');

on a multi dimensional list, I get all direct children. But when I run

$descendants = $crawler->filter('ul li');

I expect to get all descendants, but instead I get nothing. What am I doing wrong?

mattalxndr
  • 9,143
  • 8
  • 56
  • 87

1 Answers1

0

Wouter J was right, it's not possible. But this is an acceptable workaround:

$descendants = $crawler->filter('ul')->filter('li');
mattalxndr
  • 9,143
  • 8
  • 56
  • 87