Conectarse a la URL y volcar la página web en Groovy


Me gustaría abrir una página web desde groovy, volcar la página web especificada y, finalmente, volcar la página web detrás de una etiqueta de anclaje.

¿Alguien tiene algún código de ejemplo para esto?

Author: Behe, 2009-06-03

2 answers

Este es un buen ejemplo

Http://docs.codehaus.org/display/GROOVY/Simple + archivo + descargar + desde + URL

Básicamente quieres hacer algo como

def data = new URL(feedUrl).getText()
 53
Author: Mark Sailes,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-05 08:55:48

Aquí hay una variación

println 'http://www.google.com'.toURL().text
 79
Author: danb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-06-05 00:00:33