cheerio - A tiny, fast, and elegant implementation of core jQuery designed specifically for the server.
Fast, flexible & lean implementation of core jQuery designed specifically for the server.
$ sbt clean publish-local
Before running the tests the first time, you must ensure the npm packages are installed:
$ npm install
Then you can run the tests:
$ sbt test
import io.scalajs.npm.cheerio._
val input = """<h2 class="title">Hello world</h2>"""
val $ = Cheerio.load(input)
$("h2.title").text("Hello there!")
$("h2").addClass("welcome")
val output = $.html()
println(s"after: $output") // => <h2 class="title welcome">Hello there!</h2>
To add the Cheerio
binding to your project, add the following to your build.sbt:
libraryDependencies += "io.scalajs.npm" %%% "cheerio" % "0.5.0"
Optionally, you may add the Sonatype Repository resolver:
resolvers += Resolver.sonatypeRepo("releases")