Skip to content

Instantly share code, notes, and snippets.

@lyhcode
Created December 30, 2012 13:34
Show Gist options
  • Save lyhcode/4412840 to your computer and use it in GitHub Desktop.
Save lyhcode/4412840 to your computer and use it in GitHub Desktop.
Groovy + Jsoup
@Grab('org.jsoup:jsoup:1.7.1')
def doc = org.jsoup.Jsoup.connect("https://news.google.com/nwshp?hl=zh-TW&tab=wn").get()
doc.select("#s_POPULAR .titletext").each {
node->
println "title=${node.text()}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment