Last active
July 20, 2017 04:46
-
-
Save eldritchideen/ef9295ff6c2f6aeca24e to your computer and use it in GitHub Desktop.
Web scraping in Scala with Jsoup
This file contains 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
import org.jsoup.Jsoup | |
import org.jsoup.nodes.Element | |
import scala.collection.JavaConversions._ | |
System.setProperty("http.proxyHost", "xxx.xxx.xxx") | |
val doc = Jsoup.connect("http://www.smh.com.au/business/markets/52-week-highs?page=-1").get() | |
//doc.body() | |
val elems = doc.select("#content > section > table > tbody > tr > th > a") | |
val foo = for ( e <- elems) yield e.text | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It helps: