Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement