Created
October 13, 2014 04:23
-
-
Save tuliang/6819170f25e5a212f81e to your computer and use it in GitHub Desktop.
Get first match of image name in URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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