Last active
April 2, 2023 10:12
-
-
Save dacr/3d445a9025607dde340bc6e45a9fbfdf to your computer and use it in GitHub Desktop.
Extract stock data fro boursorama / published by https://github.com/dacr/code-examples-manager #415dfef7-d716-4a5e-8d19-68bcc6e7d905/16fe50667f9fb7254378c9e6f8ba23b9077f0e6b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// summary : Extract stock data fro boursorama | |
// keywords : scala, stocks, data, boursorama, | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 415dfef7-d716-4a5e-8d19-68bcc6e7d905 | |
// created-on : 2020-12-01T13:14:03Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// execution : scala ammonite script (http://ammonite.io/) - run as follow 'amm scriptname.sc' | |
import $ivy.`org.json4s::json4s-jackson:3.6.10` | |
import $ivy.`org.json4s::json4s-ext:3.6.10` | |
import $ivy.`net.ruippeixotog::scala-scraper:2.2.0` | |
import net.ruippeixotog.scalascraper.browser.JsoupBrowser | |
import net.ruippeixotog.scalascraper.dsl.DSL.Extract._ | |
import net.ruippeixotog.scalascraper.dsl.DSL._ | |
val browser = JsoupBrowser() | |
val id = "TSLA" | |
val doc = browser.get(s"https://www.boursorama.com/cours/$id/") | |
//(doc >> extractor("span.c-instrument.c-instrument--last",text)) | |
val value = (doc >> extractor("span.c-instrument--last",text)) | |
println(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment