Skip to content

Instantly share code, notes, and snippets.

@bryantee
Last active May 13, 2017 17:33
Show Gist options
  • Save bryantee/da274fb1173e36dac0e2de9bbf03bfbc to your computer and use it in GitHub Desktop.
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.
#!/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