Last active
August 29, 2015 14:05
-
-
Save jeremyjbowers/06abbb531bb33c00745b to your computer and use it in GitHub Desktop.
Hate not knowing when AK Senate results will be reported? Here you go.
This file contains hidden or 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/env python | |
# -*- coding: utf-8 -*- | |
import threading | |
from bs4 import BeautifulSoup | |
import requests | |
def check_results(): | |
threading.Timer(30.0, check_results).start() | |
r = requests.get('http://soaelections.gci.net/data/results.htm') | |
soup = BeautifulSoup(r.content) | |
results = soup.select('table')[3].select('tr')[4].select('td')[2].text | |
if results == '': | |
print "." | |
else: | |
print results | |
if __name__ == "__main__": | |
check_results() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment