Get the title and array of images from a remote URL
Im looking for a way to fetch remote title and an 开发者_Python百科array of the images on the remote page in rails
Any out there that knows how ?
Sure. Just use a library like Nokogiri:
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open 'http://www.example.com')
doc.css('img') # => A collection of img nodes
Refer to the documentation for more details.
精彩评论