Strategy for generating an XPath selector based on the nth-child position of an element.

Implements

Constructors

Methods

Constructors

Methods

  • Generates an XPath selector part for the given element based on its sibling index.

    Parameters

    • element: Element

      The DOM element for which to generate the selector.

    Returns null | SelectorPart

    A SelectorPart object containing the XPath expression and its penalty, or null if the index cannot be determined.