开发者

Get the title and array of images from a remote URL

开发者 https://www.devze.com 2023-03-16 05:14 出处:网络
Im looking for a way to fetch remote title and an 开发者_Python百科array of the images on the remote page in rails

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

精彩评论

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