Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- from bs4 import BeautifulSoup
- import time
- def getData():
- # specify the url
- web = 'file:///Users/apc/Desktop/Scoreboard/scoreboard.html'
- #query the website and return the html to the variable 'page'
- page = urllib2.urlopen(web)
- # parse the html using beautiful soup and store in variable 'soup'
- soup = BeautifulSoup(page,'html.parser')
- # get the index
- single_num = soup.find('span', {'id': 'single'})
- print single_num.text
- while True:
- getData()
- time.sleep(5)
Add Comment
Please, Sign In to add comment