Interface DomQueryable

All Known Subinterfaces:
BodyElement, ButtonElement, CanvasElement, ComponentElement, DelphiElement, Document, Element, HeadElement, InputElement, ItemElement, JavaObjectElement, OptionElement, ScriptElement, StyleElement

public interface DomQueryable
Represents an object that supports querying its descendant elements.
  • Method Details

    • getElementsByTagName

      @NotNull @NotNull List<Element> getElementsByTagName(@NotNull @NotNull String tagName)
      Gets an array list of elements by their tag name
      Parameters:
      tagName - Element tag name
      Returns:
      An array list of elements with the specified tag name
      Throws:
      NullPointerException - if tagName is null
    • getElementsByClassName

      @NotNull @NotNull List<Element> getElementsByClassName(@NotNull @NotNull String className)
      Gets an array list of elements with the specified class name
      Parameters:
      className - Class name to search for
      Returns:
      An array list of elements with the specified class.
    • querySelectorAll

      @NotNull @NotNull List<Element> querySelectorAll(@NotNull @NotNull String query) throws ParserException
      Gets all the elements that match the specified query CSS selector, or group of selectors.
      Parameters:
      query - CSS selector
      Returns:
      Array list of all matching elements, may be empty
      Throws:
      ParserException - If the query could not be parsed into a CSS selector
    • querySelector

      @Nullable @Nullable Element querySelector(@NotNull @NotNull String query) throws ParserException
      Gets the first element that matches the specified query CSS selector or group of selectors.

      Matching is done in a depth-first traversal of nodes.

      Parameters:
      query - CSS Selector
      Returns:
      Found element, or null, if no matching node was found
      Throws:
      ParserException - If the query could not be parsed into a CSS selector