我想下载打开红宝石中链接https://data.gov.in/resources/all-india-pincode-directory/download的页面下载的文件
答案 0 :(得分:0)
我希望这对你有帮助,
puts " download start"
url = 'https://data.gov.in/resources/all-india-pincode-directory/download '
open('all_india_pin_code.csv', 'wb') do |file|
file << open(url).read
end
puts " download end"
答案 1 :(得分:0)
有一个名为Open URI的标准库...你试过吗?
require 'open-uri'
file = open("https://data.gov.in/resources/all-india-pincode-directory/download")