Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'nokogiri'
- require 'open-uri'
- require 'byebug'
- urltext = 'http://oploverz.in/page/%d'
- links = []
- (1..5).each do |i|
- page = Nokogiri::HTML(open(urltext % i))
- page.css('.dtl h2 a[href]').each do |line|
- links << line.attr(:href)
- end
- end
- # oploverzs = []
- links.each do |link|
- page = Nokogiri::HTML(open(link))
- name = page.css('.dtl h1').text.strip
- sinops = page.css('.sinop p').text.strip
- smalls = []
- linksm = page.css('.soraddl.op-download')[0..1]
- lists = linksm.css('.soraurl.list-download')[0..5]
- lista = lists.css('span strong a[href]')[0..21].each do |small|
- smalls << small.attr(:href).strip.split(' | ')
- end
- mediums = []
- linkm = page.css('.soraddl.op-download')[0..1]
- listm = linkm.css('.soraurl.list-download')[1..6]
- listb = listm.css('span a[href]')[4..24].each do |medium|
- mediums << medium.attr(:href).strip.split(' | ')
- end
- hades = []
- linkhade = page.css('.soraddl.op-download')[0]
- listhade = linkhade.css('.soraurl.list-download')[3]
- listhd = listhade.css('span a[href]').each do |hade|
- hades << hade.attr(:href)
- end
- puts hades
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement