0

Is it possible to use wild card to not select some UL LI element like following?

<ul>
<li id="i_touch1"></li>
<li id="i_touch2"></li>
<li id="i_touch3"></li>
<li></li> <-- this one
<li></li> <-- this one
</ul>

Best regards,

Leo S
  • 375
  • 5
  • 12

1 Answers1

0

Something like this?

$crawler->filterXPath('//ul/li[@id]');

Explaination

It select (at any deep level) all ul tags. Inside those tags, it search (and select) for li "direct childs" (so not nested ones) that has id attribute

DonCallisto
  • 29,419
  • 9
  • 72
  • 100