Skip to content

Instantly share code, notes, and snippets.

@tuliang
Created October 13, 2014 04:23
Show Gist options
  • Save tuliang/6819170f25e5a212f81e to your computer and use it in GitHub Desktop.
Save tuliang/6819170f25e5a212f81e to your computer and use it in GitHub Desktop.
Get first match of image name in URL
doc = Nokogiri::HTML( page.html )
img_srcs = doc.css('img').map{ |i| i['src'] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment