Guest User

Untitled

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