Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'nokogiri'
- require 'open-uri'
- require 'pry'
- require 'uri'
- require 'cgi'
- require 'watir'
- require 'selenium-webdriver'
- require 'phantomjs'
- browser = Selenium::WebDriver.for :phantomjs
- browser.navigate.to "http://www63.zippyshare.com/v/31341153/file.html"
- browser.find_element(:xpath, '//*[@id="dlbutton"]').click
- if browser.text.include? 'File does not exist on this server'
- puts 'File not downloaded'
- else
- puts 'Found the file: downloading'
- end
Advertisement
Add Comment
Please, Sign In to add comment