Connect to URL and dump webpage in Groovy
47,622
Solution 1
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()
Solution 2
here is a variation
println 'http://www.google.com'.toURL().text
Related videos on Youtube
Author by
Admin
Updated on May 05, 2020Comments
-
Admin about 4 years
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?
-
shabunc over 12 yearsas for me any getter method which actually can have params is handier to call directly. getText('utf-8') cannot be shortcuted.
-
Armand almost 11 yearsthis getter doesn't have params
-
Piko about 5 yearsLove this. When I code in Groovy, I feel guilty since complicated tasks are so simple!