I want to parse a web page in Groovy and extract all of the href links and the associated text with it.
If the page contained these links:
Try a regular expression. Something like this should work:
(html =~ /(.*?)<\/a>/).each { url, text -> // do something with url and text }
Take a look at Groovy - Tutorial 4 - Regular expressions basics and Anchor Tag Regular Expression Breaking.