Skip to content

Instantly share code, notes, and snippets.

@jeremyjbowers
Last active August 29, 2015 14:05
Show Gist options
  • Save jeremyjbowers/06abbb531bb33c00745b to your computer and use it in GitHub Desktop.
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.
#!/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