Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'open-uri'
- open('http://pragprog.com') do |f|
- puts f.read.scan(/<img alt=".*?" src="(.*?)"/m).uniq[0,3]
- end
- C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/open-uri.rb:223:in
- `open_loop': redirection forbidden: http://pragprog.com ->
- https://pragprog.com/ (Runti meError)
- from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/open-uri.rb:149:in
- `open_uri'
- from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/open-uri.rb:688:in `open'
- from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/open-uri.rb:34:in `open'
- from ./lib/methods.rb:123:in `<main>'
- require 'open-uri'
- open('http**s**://pragprog.com') do |f|
- puts f.read.scan(/<img alt=".*?" src="(.*?)"/m).uniq[0,3]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement