I'm creating a small app for myself where I run a Ruby script and save all of the images off of my blog.
I can't figure out how to save the image files after I've identified them. Any help would be much appreciated.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url = '[my blog url]'
doc = Nokogiri::HTML(open(url))
doc.css("img").each do |item|
#something
end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…