Guest User

Untitled

a guest
Jan 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. require "nokogiri"
  2. require "open-uri"
  3. require "pry"
  4.  
  5. page = Nokogiri::HTML(open("https://www.website_i_want_datas_from.com"))
  6.  
  7. myscrapp_2 = []
  8.  
  9. for k in (1..500) do
  10.  
  11. ((page.css("div[@class='wrapper']/div/div//ul[k]/li[4]").text() =~ /@/) != nil ? myscrapp_2 << page.css("div[@class='wrapper']/div/div//ul[k]/li[4]").text()
  12. : myscrapp_2 << page.css("div[@class='wrapper']/div/div//ul[k]/li[5]").text())
  13.  
  14. binding.pry
  15. end
Add Comment
Please, Sign In to add comment