質問

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?

役に立ちましたか?

解決

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

$descendants = $crawler->filter('ul')->filter('li');
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top