SHARE
TWEET

Untitled

a guest Aug 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def getCoinUpdatedTable(webPage: String,
  2.                         tableNameInHTML: String): Vector[CoinCreate] = {
  3.   val site = siteConnect(webPage, new JsoupBrowser()) // Connects to the webpage.
  4.  
  5.   val tab = site >> table(s"#${tableNameInHTML}") // Gets the table with the given name.
  6.  
  7.   val body = tab.slice(1, tab.length) // First index belongs to the header of the table.
  8.  
  9.   body.map(x => CoinCreate(x.map(_.text).toList)) // Table rows are mapped to CoinCreate case class.
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top