I have to make a request to a page www.example.com/xls_file
which sends a file. I have Nokogiri and Mechanize available. How would I download the file and save it locally?
def file
grab_file if !File.exists?("sales_data.csv")
File.open("sales_data.csv")
end
def grab_file
# What do I do here?
# Nokogiri::HTML(open("http://www.example.com/xls_file"))
end