Connect to URL and dump webpage in Groovy

前端 未结 2 645
自闭症患者
自闭症患者 2020-12-09 01:00

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 t

相关标签:
2条回答
  • 2020-12-09 01:44

    here is a variation

    println 'http://www.google.com'.toURL().text
    
    0 讨论(0)
  • 2020-12-09 01:45

    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()
    
    0 讨论(0)
提交回复
热议问题