Last active
May 13, 2017 17:33
-
-
Save bryantee/da274fb1173e36dac0e2de9bbf03bfbc to your computer and use it in GitHub Desktop.
Python script using Selenium to refresh StackOverflow every so often to get badge.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from selenium import webdriver | |
from datetime import datetime | |
import time | |
import urllib | |
url = "http://stackoverflow.com" | |
everyXHours = 6 | |
refreshrate = 60 * 60 * everyXHours # Refresh every hour | |
browser = webdriver.Firefox() | |
browser.get(url) | |
while True: | |
time.sleep(refreshrate) | |
browser.refresh() | |
now = datetime.now() | |
print(now) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment