Guest User

Untitled

a guest
Feb 16th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.55 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. require 'nokogiri'
  3. require 'open-uri'
  4. require 'sequel'
  5. require 'sqlite3'
  6. require 'pry'
  7. require 'uri'
  8. require 'cgi'
  9. require 'watir'
  10. require 'selenium-webdriver'
  11. require 'phantomjs'
  12.  
  13.  
  14.   browser = Selenium::WebDriver.for :phantomjs
  15.   browser.navigate.to "http://www63.zippyshare.com/v/31341153/file.html"
  16.   browser.find_element(:xpath, '//*[@id="dlbutton"]').click
  17.  
  18.     if browser.text.include? 'File does not exist on this server'
  19.       puts 'File not downloaded'
  20.     else
  21.       puts 'Found the file: downloading'
  22.       end
Advertisement
Add Comment
Please, Sign In to add comment