Advertisement
t_a_w

Box List

Oct 18th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.43 KB | None | 0 0
  1. require "nokogiri"
  2.  
  3. home_page = Nokogiri::HTML(`curl -s "https://www.vulnhub.com/"`)
  4. pages     = home_page.css(".pagination ul li a").map{|link| link[:href][/=(\d+)/,1]}.compact.map(&:to_i).max
  5.  
  6. puts "Getting box names for #{pages} pages:",""
  7.  
  8. box_list = (1..pages).map do |page|
  9.   doc = Nokogiri::HTML(`curl -s "https://www.vulnhub.com/?page=#{page}"`)
  10.   doc.css("h1 a").map(&:text)
  11. end.flatten.sort_by(&:downcase)
  12.  
  13. puts box_list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement