| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import _html
- import _bs
- import pytz
- import datetime
- """
- Modules _html and _bs4 contain specialized methods.
- """
- local_timezones = {
- "NSW": "Australia/Sydney",
- "VIC": "Australia/Melbourne",
- "QLD": "Australia/Brisbane",
- "WA": "Australia/Perth",
- "SA": "Australia/Adelaide",
- "TAS": "Australia/Hobart",
- "ACT": "Australia/Sydney",
- "NT": "Australia/Darwin"}
- def scrape_main_page():
- this_url = """https://racingaustralia.horse/Home.aspx"""
- this_data = _html.get_page(this_url)
- venues_all = _bs.get_today_row(this_data)
- return venues_all
- def get_scratchings(this_venue):
- this_data = _html.get_page(this_venue[3])
- # print(this_data)
- race_day_info = _bs.get_meta_data(this_data, this_venue)
- return race_day_info
- def convert_to_unixtime(dt_object):
- utc = pytz.UTC
- d = dt_object.astimezone(utc)
- epoch = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=pytz.UTC)
- ts = int((d - epoch).total_seconds())
- return ts
|