Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'nokogiri'
- require 'open-uri'
- urltext = 'http://oploverz.in/page/%d/'
- links = []
- (1..3).each do |i|
- page = Nokogiri::HTML(open(urltext % i))
- page.css('.dtl h2 a[href]').each do |line|
- links << line.attr(:href)
- end
- end
- links.each do |link|
- post = Nokogiri::HTML(open(urltext))
- name = post.css(".dtl h1")
- sinops = post.css(".sinop p")
- oplink = post.css("soraddl.op-download")[0]
- opdl = oplink.css(".soraurl.list-download")[0..1]
- small = opdl.css("span strong a[href]")[0..3].attr(:href)
- medium = opdl.css("span strong a[href]")[4..7].attr(:href)
- posts << {
- name: name,
- sinops: sinops,
- small: small,
- medium: medium
- }
- end
- puts posts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement