Skip to content

Instantly share code, notes, and snippets.

@fmamud
Last active November 12, 2015 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmamud/37883e586883b2823c35 to your computer and use it in GitHub Desktop.
Save fmamud/37883e586883b2823c35 to your computer and use it in GitHub Desktop.
History languages using Geb and Wikipedia
@Grapes([
@Grab("org.gebish:geb-core:0.12.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.45.0"),
@Grab("org.seleniumhq.selenium:selenium-support:2.45.0")
])
import geb.Browser
Browser.drive {
go "https://en.wikipedia.org/wiki/Groovy_(programming_language)"
def lang = $("caption", class: "summary").text()
if (lang) {
def links = $("th", text: "Influenced").parent().next().$("a").hasNot("span")
if (links) {
def influencers = links.collectEntries { [(it.text()):it.@href] }
println "$lang=> $influencers"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment