Advertisement
Guest User

Untitled

a guest
Jun 9th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import urllib.request
  3. import datetime
  4.  
  5. #This section determines the date of the next Saturday which will go onto the end of     the URL
  6. d = datetime.date.today()
  7. while d.weekday() != 5:
  8.     d += datetime.timedelta(1)
  9.  
  10. #temporary logic for testing when next webpage isn't out
  11. d = "2013-06-01"
  12.  
  13. #Section that scrapes the data off the webpage
  14. url = "http://www.sydgram.nsw.edu.au/co-curricular/sport/fixtures/" + str(d) + ".php"
  15. page = urllib.request.urlopen(url)
  16. soup = BeautifulSoup(page)
  17.  
  18. #Section that grabs the table with stuff in it
  19. table = soup.find('table', {"class": "excel1"})
  20. print(table)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement