browser.with { go 'https://docs.docker.com/docker-for-mac/install/' def applink = $('a',text:'Get Docker for Mac (Stable)') println "----- ${applink.@href}" def conn = download(applink.@href) if(conn.getResponseCode()==HttpURLConnection.HTTP_OK){ InputStream is = conn.getInputStream() OutputStream os = new File('./Docker.dmg').newOutputStream() os << is is.close() os.close() } } @Grab('org.gebish: