Skip to content

Instantly share code, notes, and snippets.

@rvowles
Created September 29, 2012 01:54
Show Gist options
  • Save rvowles/3802898 to your computer and use it in GitHub Desktop.
Save rvowles/3802898 to your computer and use it in GitHub Desktop.
How to login and get your list of books from the Auckland Public Library in Groovy using jsoup
Connection conn = Jsoup.connect("http://www.elgar.govt.nz/patroninfo")
conn.get();
conn.url('http://www.elgar.govt.nz/patroninfo/patform')
conn.data('code', '')
conn.data('pin', '')
Document login = conn.post()
Elements books = login.select('.patFuncTitle label a')
books.each { Element e ->
println e.text()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment