score:4

Accepted answer

Well you could use the excellent scala-scraper library here : Its basically a wrapper for the JSoup Java library
You could write code that reads like this :(taken from GitHub)

object NewsApp extends App {
  val browser = JsoupBrowser()
  val doc = browser.get("http://observador.pt")

  println()
  println("=== OBSERVADOR ===")

  doc >> extractor(".logo img", attr("src")) |> println
  doc >> extractorAt[String]("example-extractor") |> println

  println("==================")
  println()

  doc >> ".small-news-list h4 > a" foreach println
}

score:0

How are you getting html page in Scala ? I think you can look at spray-client http://spray.io/documentation/1.2.3/spray-can/http-client/


Related Query

More Query from same tag