Describes a XPath expression compilation error.
Represents the result of taking a string and compiling it into an XPath query.
Represents the result of taking a string and compiling it into an XPath query.
kantan.codecs.Result
Compiles XPath expressions.
Compiles XPath expressions.
There's very little reason to interact with this class directly, it's only meant to act as a bridge between XPathCompiler and Query.
Describes an error that occurred while decoding some XML content.
Represents the result of taking some raw XPath result and turning it into a usable type.
Represents the result of taking some raw XPath result and turning it into a usable type.
Creation methods can be found in the companion object.
kantan.codecs.Result
Type class for types that can be decoded from an XML Node.
Provides default NodeDecoder instances.
Describes errors that occur while parsing XML content.
Represents the result of taking some raw data and turning it into a usable type.
Represents the result of taking some raw data and turning it into a usable type.
Creation methods can be found in the companion object.
kantan.codecs.Result
Compiled XPath expression.
Compiled XPath expression.
Instance creation is achieved through the companion object.
Describes an error that occurred while parsing and / or decoding XML content.
Represents the result of applying an XPath expression, applying to raw data and turning it into usable types.
Represents the result of applying an XPath expression, applying to raw data and turning it into usable types.
A ReadResult is either a DecodeResult or a ParseResult.
kantan.codecs.Result
XmlSource implementation anything that can be turned into a java.io.URL
.
XmlSource implementation anything that can be turned into a java.io.URL
.
The main purpose here is to allow application developers to set their own HTTP headers: when scrapping websites, it's typically necessary to change the default user agent to something a bit more browser-like.
Describes how to retry failed request for RemoteXmlSource.
Describes how to retry failed request for RemoteXmlSource.
Constructors for commonly used patterns can be found in the RetryStrategy$ companion object.
maximum number of attempts that can be made for a given request.
delay, in milliseconds, between each attempt.
function that calculates the delay factor based on the number of requests already attempted.
In order to double waiting times between each attempt, for example, one would pass
i ⇒ 2 ^ i
.
Compiles XPath expressions.
Compiles XPath expressions.
There's always a default instance in scope, which should be perfectly suitable for most circumstances. Still, if some non-standard options are required, one can always declare a local implicit instance.
Describes an error that can occur while dealing with XPath.
Represents the result of any XPath action.
Represents the result of any XPath action.
An XPathResult is either a CompileResult or a ReadResult.
kantan.codecs.Result
Contract for anything that knows how to parse XML.
Contract for anything that knows how to parse XML.
The default implementation is always in scope and uses the standard java javax.xml.parsers.DocumentBuilderFactory
,
with no special option. This can be overridden to set some options or, more drastically, to change the parsing
mechanism entirely. A typical use case is the nekohtml
module, which needs to take control of the entire parsing
process to tidy up messy HTML documents.
Type class for turning instances of A
into valid instances of Node.
Type class for turning instances of A
into valid instances of Node.
While it's certainly possible, instances of XmlSource are rarely used directly. The preferred, idiomatic way
is to use the implicit syntax provided by XmlSourceOps, brought in scope by
importing kantan.xpath.ops._
.
See the companion object for construction methods and default instances.
Provides implicit methods to summon Compiler instances.
Provides instance creation methods for DecodeResult.
Provides instance creation and summoning methods.
Provides instance creation methods for ParseResult.
Provides convenient methods for XPath expression compilation.
Provides convenient methods for XPath expression compilation.
Actual compilation is done through instances of Compiler. Methods declared here will simply summon the right implicit value.
Declares the default XmlParser instance in the implicit scope.
Defines convenience methods for creating and summoning XmlSource instances.
Defines convenience methods for creating and summoning XmlSource instances.
Default implementation of standard types are declared here, always bringing them in scope without requirnig an explicit import.
The default implementations can also be useful when writing new instances: if you need to write an XmlSource[T]
and already have an XmlSource[S]
and a T ⇒ S
, you just need to call XmlSource.contramap to get your
implementation.