Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.42 KB | None | 0 0
  1. class ProxyList
  2.   LINK = 'https://proxy-list.org/russian/index.php?p='
  3.  
  4.   def parse
  5.     result = []
  6.  
  7.     (1..10).each do |n|
  8.       doc = Nokogiri::HTML(open("#{LINK}#{n}"))
  9.       doc.css('table li.proxy').each do |node|
  10.         nodeText = node.children.text
  11.         if nodeText['Proxy']
  12.           puts Base64.decode64 nodeText.split("(")[1].split("'")[1]
  13.         end
  14.       end
  15.     end
  16.  
  17.     result
  18.   end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement