Ruby将网页中的图片保存到本地 2015/07/14 15103 require 'net/http' Net::HTTP.start("www.google.com.hk") { |http| resp = http.get("/images/srpr/nav_logo27.png") open("D:/test.png", "wb") { |file| file.write(resp.body) } } puts "OK"