Skip to content

Instantly share code, notes, and snippets.

@yasufumy
Created December 13, 2015 08:31
Show Gist options
  • Save yasufumy/cc7c4632a41383dc9cb7 to your computer and use it in GitHub Desktop.
Save yasufumy/cc7c4632a41383dc9cb7 to your computer and use it in GitHub Desktop.
from selenium import webdriver
import time
if __name__ == '__main__':
# start firefox
driver = webdriver.Firefox()
# load eye test
driver.get('http://wvw.igame.com/eye-test/')
# wait loading
time.sleep(3)
# switch to the iframe
driver.switch_to_frame(driver.find_element_by_tag_name('iframe'))
# click correct box
try:
while True:
driver.find_element_by_class_name('thechosenone').click()
except:
driver.get_screenshot_as_file('./result.png')
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment