Interface ElementQueryMethods<E extends Element>
- All Superinterfaces:
IsElement<E>
- All Known Implementing Classes:
HTMLContainerBuilder, HTMLElementBuilder, HTMLInputElementBuilder, HTMLSelectElementBuilder, HTMLTextAreaElementBuilder, Link, MathMLContainerMethods, MathMLElementBuilder, SVGContainerBuilder, SVGElementBuilder
Provides methods and default implementations for finding elements.
By selector = By.element("a").and(By.attribute("href", STARTS_WITH, "https://"));
for (HTMLElement element : body().querySelectorAll(selector)) {
a(element).css("external");
}
-
Method Summary
Modifier and TypeMethodDescriptiondefault <F extends HTMLElement>
FFinds the closest HTML element for the given selector.default <F extends HTMLElement>
FquerySelector(By selector) Finds a single HTML element for the given selector.default Iterable<HTMLElement> querySelectorAll(By selector) Finds all HTML elements for the given selector.
-
Method Details
-
querySelectorAll
Finds all HTML elements for the given selector. -
querySelector
Finds a single HTML element for the given selector. -
closest
Finds the closest HTML element for the given selector.
-