Ruby将网页中的图片保存到本地

2015-07-14 0 639
Ruby将网页中的图片保存到本地
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"

遇见资源网 ruby Ruby将网页中的图片保存到本地 http://www.ox520.com/16409.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务