开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜