Advertisement
sinulucky

code

Feb 2nd, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. require 'open-uri'
  2. require 'nokogiri'
  3. require 'csv'
  4.  
  5. url = 'http://oploverz.in/'
  6.  
  7. #parse halaman dengan nokogiri
  8. page = Nokogiri::HTML(open(url))
  9.  
  10.  
  11. #store data in arrays
  12. links = []
  13.  
  14. page.css('.dtl a[href]').each do |line|
  15. links << line
  16. end
  17.  
  18. puts links
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement