final case class RemoteXmlSource[A](toURL: (A) => ParseResult[URL], retry: RetryStrategy, headers: Map[String, String])(implicit parser: XmlParser) extends XmlSource[A] with Product with Serializable
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 scraping websites, it's typically necessary to change the default user agent to something a bit more browser-like.
- Source
- RemoteXmlSource.scala
- Alphabetic
- By Inheritance
- RemoteXmlSource
- Product
- Equals
- XmlSource
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RemoteXmlSource(toURL: (A) => ParseResult[URL], retry: RetryStrategy, headers: Map[String, String])(implicit parser: XmlParser)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asNode(a: A): ParseResult[Node]
Turns the specified value into a Node.
Turns the specified value into a Node.
Results are wrapped in a ParseResult, which makes this method safe. For an unsafe alternative, see asUnsafeNode.
- Definition Classes
- RemoteXmlSource → XmlSource
- def asUnsafeNode(a: A): Node
Turns the specified value into a Node.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def contramap[B](f: (B) => A): RemoteXmlSource[B]
Turns an
XmlSource[A]
into anXmlSource[B]
.Turns an
XmlSource[A]
into anXmlSource[B]
.- Definition Classes
- RemoteXmlSource → XmlSource
- See also
- def contramapResult[AA <: A, B](f: (B) => ParseResult[AA]): RemoteXmlSource[B]
Turns an
XmlSource[A]
into anXmlSource[B]
.Turns an
XmlSource[A]
into anXmlSource[B]
.- Definition Classes
- RemoteXmlSource → XmlSource
- See also
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def eval[B](a: A, expr: Query[DecodeResult[B]]): ReadResult[B]
Evaluates the specified XPath expression against specified value.
Evaluates the specified XPath expression against specified value.
- Definition Classes
- XmlSource
- def eval[B](a: A, expr: XPathExpression)(implicit arg0: Compiler[B]): XPathResult[B]
Compiles the specified XPath expression and evaluates it against the specified value.
Compiles the specified XPath expression and evaluates it against the specified value.
- Definition Classes
- XmlSource
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val headers: Map[String, String]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val retry: RetryStrategy
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val toURL: (A) => ParseResult[URL]
- def unsafeEval[B](a: A, expr: Query[DecodeResult[B]]): B
Evaluates the specified XPath expression against specified value.
Evaluates the specified XPath expression against specified value.
- Definition Classes
- XmlSource
- Annotations
- @SuppressWarnings()
- def unsafeEval[B](a: A, expr: XPathExpression)(implicit arg0: Compiler[B]): B
Compiles the specified XPath expression and evaluates it against specified value.
Compiles the specified XPath expression and evaluates it against specified value.
- Definition Classes
- XmlSource
- Annotations
- @SuppressWarnings()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withHeader(name: String, value: String): RemoteXmlSource[A]
Sets the specified header to the specified value.
- def withRetry(strategy: RetryStrategy): RemoteXmlSource[A]
- def withUserAgent(value: String): RemoteXmlSource[A]
Sets the user-agent to use whenever connecting to a URL.