annotate refresh-browser.py @ 9:d09937a6cb4b
trying to build something to automatically refresh the browser.
author |
Robert McIntyre <rlm@mit.edu> |
date |
Tue, 25 Oct 2011 05:33:36 -0700 |
parents |
|
children |
83e16df2288a |
rev |
line source |
rlm@9
|
1 #!/usr/bin/env python
|
rlm@9
|
2
|
rlm@9
|
3
|
rlm@9
|
4 from selenium import webdriver
|
rlm@9
|
5 from selenium.common.exceptions import TimeoutException
|
rlm@9
|
6 from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
|
rlm@9
|
7 import time
|
rlm@9
|
8
|
rlm@9
|
9 # Create a new instance of the Firefox driver
|
rlm@9
|
10 #driver = webdriver.Firefox()
|
rlm@9
|
11
|
rlm@9
|
12 driver = webdriver.Remote("http://localhost:4444/wd/hub", webdriver.DesiredCapabilities.FIREFOX)
|
rlm@9
|
13
|
rlm@9
|
14
|
rlm@9
|
15 # go to the google home page
|
rlm@9
|
16 driver.get("http://tycho.usno.navy.mil/cgi-bin/timer.pl")
|
rlm@9
|
17
|
rlm@9
|
18 # you HAVE to quit if you're reusing firefox sessions
|
rlm@9
|
19 driver.quit()
|