A wrapper around Chunk[Dom] that provides fluent chaining for CSS selector-based DOM navigation and querying operations.
DomSelection enables a fluent API style for navigating through DOM structures:
dom.select(CssSelector.Element("div")).children.select(CssSelector.Element("p")).texts
The selection can contain zero, one, or multiple DOM nodes, supporting both single-value navigation and multi-value queries.
Attributes
- Companion
- object
- Source
- DomSelection.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Combines two selections.
Returns a selection containing the node at the given index.
Extracts attribute values with the given name from all element nodes in this selection.
Extracts attribute values with the given name from all element nodes in this selection.
Attributes
- Source
- DomSelection.scala
Returns the direct children of all element nodes in this selection.
Returns the direct children of all element nodes in this selection.
Attributes
- Source
- DomSelection.scala
Returns all descendant nodes of all element nodes in this selection (excluding the nodes themselves).
Returns all descendant nodes of all element nodes in this selection (excluding the nodes themselves).
Attributes
- Source
- DomSelection.scala
Filters this selection to keep only Element nodes.
Filters the selection by a predicate.
Returns a selection containing only the first node.
Returns the first node if present.
Returns true if this selection contains no nodes.
Returns a selection containing only the last node.
Returns the number of selected nodes.
Applies a transformation function to all Element nodes in this selection, returning the modified nodes.
Applies a transformation function to all Element nodes in this selection, returning the modified nodes.
Attributes
- Source
- DomSelection.scala
Returns true if this selection contains at least one node.
Returns an empty selection (all nodes removed).
Replaces all nodes in this selection with the given replacement.
Replaces all nodes in this selection with the given replacement.
Attributes
- Source
- DomSelection.scala
Selects all descendant nodes matching the given CSS selector.
Selects all descendant nodes matching the given CSS selector.
For simple selectors (Element, Class, Id, Universal, And, Or, Not, Attribute), searches all descendants of each node in this selection. For structural selectors (Child, Descendant), walks the tree accordingly.
Value parameters
- selector
-
the CSS selector to match against
Attributes
- Returns
-
a new selection containing all matching nodes
- Source
- DomSelection.scala
Extracts text content from all nodes in this selection.
Extracts text content from all nodes in this selection.
For Text nodes, returns the content directly. For Element nodes, returns the concatenated text of all child Text nodes.
Attributes
- Source
- DomSelection.scala
Returns the selected nodes as a Chunk.
Keeps only elements that have the given attribute (any value).
Keeps only elements that have the given attribute with the given value.
Keeps only elements that have the given attribute with the given value.
Attributes
- Source
- DomSelection.scala
Keeps only elements that have the given CSS class.
Keeps only elements that have the given id.
Keeps only elements with the given tag name.
Inherited methods
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala