Parsing using XMlSlurper only works if HTMl is well-formed.
If your HTMl page has non-well-formed tags, then use regex for parsing the page.
here, 'a' is not closed and thus not well formed.
new URL(url).eachLine{
(it =~ /.*/).each{
// process hrefs
}
}