BasicPath.ChildNumber

public static final class ChildNumber

Allows to define an element that has a predefined number of similar preceding siblings. Count starts at 1 (same as you would use in English). Should be used through the method childNumber(Integer) . Example:

childNumber(5).ofType(div);

Constructors

ChildNumber

public ChildNumber(Integer n)

Does not return any usable Path by itself. Must be used like: ChildNumber(5).ofType(div)

Parameters:
  • n – the number of child. Count starts at 1.

Methods

ofType

public Path ofType(Path path)

an element that has n similar preceding siblings. For example: ChildNumber(5).ofType(element.withText("john")) will correspond to the fifth child that has text “john”

Parameters:
  • path – the element to find
Returns:

a new Path instance