I would like to open a webpage from groovy, dump the specified webpage and eventually dump the webpage behind an anchor tag.
Does anybody has some sample code for this?
Mark Sailes
This is a good example
http://docs.codehaus.org/display/GROOVY/Simple+file+download+from+URL
Basically you want to do something like
def data = new URL(feedUrl).getText()
here is a variation
println 'http://www.google.com'.toURL().text
来源:https://stackoverflow.com/questions/943873/connect-to-url-and-dump-webpage-in-groovy