diff --git a/scrapers/sd/events.py b/scrapers/sd/events.py index a77712f464..38ea4715f5 100644 --- a/scrapers/sd/events.py +++ b/scrapers/sd/events.py @@ -1,9 +1,11 @@ -from openstates.scrape import Scraper, Event +import re import pytz import lxml import scrapelib import dateutil.parser +from openstates.scrape import Scraper, Event + class SDEventScraper(Scraper): # chambers = {"lower": "House", "upper": "Senate", "joint": "Joint"} @@ -26,7 +28,8 @@ def scrape_schedule_file(self): com_name = row["InterimYearCommitteeName"] com = {"FullName": com_name} - event = self.create_event(com, row) + location = row["Room"] + event = self.create_event(com, row, location) self.scrape_agendas_and_bills(event, row["DocumentId"]) @@ -179,12 +182,16 @@ def scrape(self): for key in events_by_date: yield events_by_date[key] - def create_event(self, committee, agenda_document): + def create_event(self, committee, agenda_document, location=""): name = committee["FullName"] start_date = dateutil.parser.parse(agenda_document["DocumentDate"]) - location = "500 E Capitol Ave, Pierre, SD 57501" + base_loc = "500 E Capitol Ave, Pierre, SD 57501" + if location and re.match(r"Room \d+", location): + location = location + ", " + base_loc + + location = location or base_loc event = Event( name=name,