Selection

io.github.frikit.twirlspec.page.Selection
See theSelection companion object
final class Selection

A named set of elements pulled out of a page.

Value parameters

elements

the matches, in document order

name

what the selection is called in failure messages

selector

the CSS selector that produced it, also for failure messages

Attributes

Companion
object
Source
Selection.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply(i: Int): Element

The match at this position in document order.

The match at this position in document order.

Attributes

Source
Selection.scala
def attr(attribute: String): Option[String]

The first match's value for this attribute, when it has one.

The first match's value for this attribute, when it has one.

Attributes

Source
Selection.scala
def attrs(attribute: String): List[String]

Every match's value for this attribute, empty ones left out.

Every match's value for this attribute, empty ones left out.

Attributes

Source
Selection.scala
def classes: Set[String]

The first match's classes.

The first match's classes.

Attributes

Source
Selection.scala
def containing(needle: String): Selection

Only the matches whose text contains this, after normalisation.

Only the matches whose text contains this, after normalisation.

Attributes

Source
Selection.scala
def filter(p: Element => Boolean): Selection

Only the matches satisfying a predicate.

Only the matches satisfying a predicate.

Attributes

Source
Selection.scala
def hasClass(c: String): Boolean

Whether any match carries this class.

Whether any match carries this class.

Attributes

Source
Selection.scala
def headOption: Option[Element]

The first match, if there is one.

The first match, if there is one.

Attributes

Source
Selection.scala
def html: String

Inner HTML of the first match.

Inner HTML of the first match.

Attributes

Source
Selection.scala
def id: Option[String]

The first match's id, if it has one.

The first match's id, if it has one.

Attributes

Source
Selection.scala
def ids: List[String]

Every match's id.

Every match's id.

Attributes

Source
Selection.scala
def isEmpty: Boolean

Whether nothing matched.

Whether nothing matched.

Attributes

Source
Selection.scala
def nonEmpty: Boolean

Whether anything matched.

Whether anything matched.

Attributes

Source
Selection.scala
def select(css: String): Selection

Narrow this selection with a further CSS selector.

Narrow this selection with a further CSS selector.

Attributes

Source
Selection.scala
def size: Int

How many elements matched.

How many elements matched.

Attributes

Source
Selection.scala
def text: String

Combined, normalised text of every matched element.

Combined, normalised text of every matched element.

Attributes

Source
Selection.scala
def texts: List[String]

Normalised text of each matched element, in document order.

Normalised text of each matched element, in document order.

Attributes

Source
Selection.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Selection.scala

Concrete fields

val elements: List[Element]

Attributes

Source
Selection.scala
val name: String

Attributes

Source
Selection.scala
val selector: String

Attributes

Source
Selection.scala