I have an NodeSeq object and want to select a given node which is marked with an attribute. For example let’s say there is a tag <div id="content">...</div> within the NodeSeq.
I tried to select in with the method \\ on NodeSeq as well as with filter.
Let’s say seq is my NodeSeq object.
seq \\ "div" works, but this selects all <div> elements.
seq.filter(_.attribute("id").equals("content")) doesn’t select any node at all, the resulting list is empty.
How can I select this node?
try
This should work.