Skip to content

Instantly share code, notes, and snippets.

@LastZactionHero
Created December 23, 2013 22:13
Show Gist options
  • Save LastZactionHero/8105745 to your computer and use it in GitHub Desktop.
Save LastZactionHero/8105745 to your computer and use it in GitHub Desktop.
require 'selenium-webdriver'
require 'selenium/client'
#system 'java -jar ~/Downloads/selenium-2.37.0/selenium-server-standalone-2.37.0.jar &'
browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.pictage.com",
:timeout_in_second => 60
browser.start_new_browser_session
browser.open("http://www.pictage.com/client/emailLogin.do?event=1508438&auth=gggggfgIgtg5gkgdgIfuk9gdgggt9d9I9A999e9j9uAtA9AA9jUJAUUe&forwardAction=/event.do?event=1508438")
(1..100).each do |i|
browser.open("http://www.pictage.com/client/eventPhotos.do?event=1508438&category=1&photo=#{i}")
source = browser.get_html_source
image_raw = source.match(/selectedPhotoImageUrls\[2\].*\'/)[0]
image_url = image_raw.gsub("selectedPhotoImageUrls[2] = '", "").gsub("'", "")
browser.open(image_url)
sleep(4)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment