Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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