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/
Source: stackoverflow.com
Related Query
- Scala get html content from web page
- Scala get page content as JSon
- Get content from Akka ResponseEntity in Scala
- How to send a data from scala to a particular div tag in Html page
- Scala get content from REST API with header
- AngularJS web client can't get resource from Scala Play server
- How to get Scala List from Java List?
- How do I get the Scala version from within Scala itself?
- Scala - Get last two characters from string
- get min and max from a specific column scala spark dataframe
- Get head item and tail items from scala list
- How to get a random element from a Set in Scala
- Get all entries having a value from List[Option] in Scala
- Can I get a Scala case class definition from an Avro schema definition?
- Can I get AST from live scala code?
- scala - get class from a string
- Get form parameter value from request in Play 2.0 Scala controller
- How to correctly get current loop count from a Iterator in scala
- How to get distinct items from a Scala Iterable, maintaining laziness
- Get the changed HTML content after it's updated by Javascript? (htmlunit)
- Strip HTML tags from Scala String
- Gatling in scala how to get url from redirect
- Spark Scala Get Data Back from rdd.foreachPartition
- How to get auto-complete in Scala REPL launched from ensime?
- How to get first line from file in Scala
- Is there a way to get a JSON-Schema from a Scala Case Class hierarchy?
- Scala - Strip all html tags from string except links
- How to set and get keys from scala TreeMap?
- Easy way to get a readable date from a long (timestamp) in scala
- Spark, Scala - How to get Top 3 value from each group of two column in dataframe
More Query from same tag
- How to pass an implicit argument indirectly
- Is the Akka Actors library installed with the Scala IDE for Scala 2.10?
- Running .sh file on Windows in git bash gives an error: Unable to find Digest::SHA or Digest::SHA::PurePerl
- Scala - Circe - Case Class Serialization without Class Name
- Gatling: Understanding rampUsersPerSec(minTPS) to maxTPS during seconds
- scala return on first Some in list
- Scala: How to get a Class[_] instance out of Type?
- any UML tools for Scala
- How can I run DataNucleus Bytecode Enhancer from SBT?
- Applying matching function to each RDD element
- Sort Spark DataFrame's column by date
- scala - using map function to concatenate JValue
- How to get full form validation error message without form helper in Play Framework 2?
- scala macro generic field of generic class not apply class generic type parameter
- Subtracting elements at specified indices in array
- scala: why is 1/0 an arithmetic exception but 1.0/0.0 = Double.Infinity
- word count in spark-scala for rdd(String,String,Long)
- IntelliJ IDEA consuming lots of CPU
- Acceptable parameter combinations for flatten method
- Long/Int in scala to hex string
- Scala assign type a dynamic value
- Constructor with non-instance variable assistant?
- Scala inheritance best practices using a container classes
- Scala Processing a file in batches
- Scala - how to set data into placeholder from config file?
- Akka OneForOneStrategy does not work
- How to represent NA in rJava
- Removing Data Type From Tuple When Printing In Scala
- Any workaround for JSONPATH wildcard not supported in Spark SQL
- Shapeless: Trying to restrict HList elements by their type