All Downloads are FREE. Search and download functionalities are using the official Maven repository.

as.soup.scala Maven / Gradle / Ivy

The newest version!
package dispatch.as.jsoup

import org.jsoup.Jsoup
import org.jsoup.nodes
import com.ning.http.client.Response

object Document extends (Response => nodes.Document) {
  def apply(r: Response) =
    Jsoup.parse(dispatch.as.String(r), r.getUri().toString)
}

object Query {
  import org.jsoup.select.Elements
  def apply(query: String): Response => Elements =
    Document(_).select(query)
} 

object Clean {
  import org.jsoup.safety.Whitelist
  def apply(wl: Whitelist): Response => String =
    { r => Jsoup.clean(dispatch.as.String(r), r.getUri().toString, wl) }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy