diff --git a/uoftscrapers/scrapers/events/__init__.py b/uoftscrapers/scrapers/events/__init__.py index 492944e..b52b92c 100644 --- a/uoftscrapers/scrapers/events/__init__.py +++ b/uoftscrapers/scrapers/events/__init__.py @@ -10,6 +10,8 @@ class Events: """A scraper for Events at the University of Toronto.""" host = 'https://www.events.utoronto.ca/' + campuses_tags = {'St. George': 'UTSG', 'U of T Mississauga': 'UTM', 'U of T Scarborough': 'UTSC'} + @staticmethod def scrape(location='.'): Scraper.logger.info('Events initialized.') @@ -74,7 +76,8 @@ def get_event_doc(url_tail): event_campus = '' if evt_bar.select('dd')[0].b != None: - event_campus = evt_bar.select('dd')[0].b.text + campus_full_name = evt_bar.select('dd')[0].b.text + event_campus = Events.campuses_tags[campus_full_name] event_address = '' address_block = evt_bar.select('dd')[0]