Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getCoinUpdatedTable(webPage: String,
- tableNameInHTML: String): Vector[CoinCreate] = {
- val site = siteConnect(webPage, new JsoupBrowser()) // Connects to the webpage.
- val tab = site >> table(s"#${tableNameInHTML}") // Gets the table with the given name.
- val body = tab.slice(1, tab.length) // First index belongs to the header of the table.
- body.map(x => CoinCreate(x.map(_.text).toList)) // Table rows are mapped to CoinCreate case class.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement