Interface Finder<E extends Element>

All Superinterfaces:
IsElement<E>
All Known Implementing Classes:
HTMLContainerBuilder, HTMLElementBuilder, InputElementBuilder

public interface Finder<E extends Element> extends IsElement<E>
Provides methods and default implementations for finding elements.

By selector = By.element("a").and(By.attribute("href", STARTS_WITH, "https://"));
for (HTMLElement element : body().findAll(selector)) {
    a(element).css("external");
}
  • Method Summary

    Modifier and Type
    Method
    Description
    default <F extends HTMLElement>
    F
    closest(By selector)
    Finds the closest HTML element for the given selector.
    default <F extends HTMLElement>
    F
    find(By selector)
    Finds a single HTML element for the given selector.
    findAll(By selector)
    Finds all HTML elements for the given selector.

    Methods inherited from interface org.jboss.elemento.IsElement

    element
  • Method Details

    • findAll

      default Iterable<HTMLElement> findAll(By selector)
      Finds all HTML elements for the given selector.
    • find

      default <F extends HTMLElement> F find(By selector)
      Finds a single HTML element for the given selector.
    • closest

      default <F extends HTMLElement> F closest(By selector)
      Finds the closest HTML element for the given selector.