Guest User

Untitled

a guest
Nov 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import urllib2
  2. from bs4 import BeautifulSoup
  3. import time
  4. def getData():
  5. # specify the url
  6. web = 'file:///Users/apc/Desktop/Scoreboard/scoreboard.html'
  7. #query the website and return the html to the variable 'page'
  8. page = urllib2.urlopen(web)
  9. # parse the html using beautiful soup and store in variable 'soup'
  10. soup = BeautifulSoup(page,'html.parser')
  11. # get the index
  12. single_num = soup.find('span', {'id': 'single'})
  13. print single_num.text
  14. while True:
  15. getData()
  16. time.sleep(5)
Add Comment
Please, Sign In to add comment