ContentParsers

net.ruippeixotog.scalascraper.scraper.ContentParsers$

An object containing functions for parsing extracted content. They can be used together with the DSL extractor method or by calling map on a HtmlExtractor with them.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

class AsDateTime extends AsJodaTime[DateTime]

A content parser with extra options for parsing DateTimes.

A content parser with extra options for parsing DateTimes.

Attributes

Graph
Supertypes
class AsJodaTime[DateTime]
trait String => DateTime
class Object
trait Matchable
class Any
class AsJodaTime[A](formats: Seq[String], parse: (DateTimeFormatter, String) => A) extends String => A

A content parser with extra options for parsing joda-time models.

A content parser with extra options for parsing joda-time models.

Attributes

Graph
Supertypes
trait String => A
class Object
trait Matchable
class Any
Known subtypes
class AsLocalDate extends AsJodaTime[LocalDate]

A content parser with extra options for parsing LocalDates.

A content parser with extra options for parsing LocalDates.

Attributes

Graph
Supertypes
class AsJodaTime[LocalDate]
trait String => LocalDate
class Object
trait Matchable
class Any
class RegexMatch extends String => String

A content parser with extra options for the retrieval of the first match of a regex.

A content parser with extra options for the retrieval of the first match of a regex.

Attributes

Graph
Supertypes
trait String => String
class Object
trait Matchable
class Any
class RegexMatches extends String => Iterator[String]

A content parser with extra options for the retrieval of all the matches of a regex.

A content parser with extra options for the retrieval of all the matches of a regex.

Attributes

Graph
Supertypes
trait String => Iterator[String]
class Object
trait Matchable
class Any

Value members

Concrete methods

def asDateTime(formats: String*): AsDateTime

Parses text content as a DateTime using one of a list of formats.

Parses text content as a DateTime using one of a list of formats.

Attributes

formats

the list of possible date formats

Returns:

a content parser for parsing text content as a DateTime.

def asIs[C]: C => C

Leaves the extracted content as is.

Leaves the extracted content as is.

Attributes

def asLocalDate(formats: String*): AsLocalDate

Parses text content as a LocalDate using one of a list of formats.

Parses text content as a LocalDate using one of a list of formats.

Attributes

formats

the list of possible date formats

Returns:

a content parser for parsing text content as a DateTime.

def regexMatch(regex: String): RegexMatch

Matches text content against a regex and returns the first match.

Matches text content against a regex and returns the first match.

Attributes

regex

the regex to match the text content against

Returns:

a content parser for matching text content against a regex and returning the first match.

def regexMatch(regex: Regex): RegexMatch

Matches text content against a regex and returns the first match.

Matches text content against a regex and returns the first match.

Attributes

regex

the regex to match the text content against

Returns:

a content parser for matching text content against a regex and returning the first match.

def regexMatches(regex: String): RegexMatches

Matches text content against a regex and returns all the matches.

Matches text content against a regex and returns all the matches.

Attributes

regex

the regex to match the text content against

Returns:

a content parser for matching text content against a regex and returning all the matches.

def regexMatches(regex: Regex): RegexMatches

Matches text content against a regex and returns all the matches.

Matches text content against a regex and returns all the matches.

Attributes

regex

the regex to match the text content against

Returns:

a content parser for matching text content against a regex and returning all the matches.

def seq[C, A](parser: C => A): IterableOnce[C] => IterableOnce[A]

Lifts a content parser to work on sequences of elements.

Lifts a content parser to work on sequences of elements.

Attributes

parser

the content parser to lift

Returns:

a content parser for parsing a sequence of elements by applying parser to each of them.

Concrete fields

val asDouble: String => Double

Parses text content as a Double value.

Parses text content as a Double value.

Attributes

val asInt: String => Int

Parses text content as an Int value.

Parses text content as an Int value.

Attributes