diff --git a/scrapers/pa/events.py b/scrapers/pa/events.py index 6b9a70c5c3..b02e979be4 100644 --- a/scrapers/pa/events.py +++ b/scrapers/pa/events.py @@ -11,6 +11,7 @@ class PAEventScraper(Scraper): _tz = pytz.timezone("US/Eastern") + chamber_names = {"upper": "Senate", "lower": "House"} def scrape(self, chamber=None): chambers = [chamber] if chamber is not None else ["upper", "lower"] @@ -92,6 +93,9 @@ def scrape_chamber(self, chamber): parsed = urllib.parse.urlparse(committee.get("href")) qs = urllib.parse.parse_qs(parsed.query) com_name = re.sub(r" \([S|H]\)$", "", committee.text) + if "joint" not in com_name.lower(): + chamber_name = self.chamber_names[chamber].upper() + com_name = f"{chamber_name} {com_name}" item.add_committee( com_name, id=qs.get("Code"), diff --git a/scrapers/usa/events.py b/scrapers/usa/events.py index a748037db0..08c9f1e677 100644 --- a/scrapers/usa/events.py +++ b/scrapers/usa/events.py @@ -249,7 +249,12 @@ def house_meeting(self, xml, source_url): coms = xml.xpath("//committees/committee-name | //subcommittees/committee-name") for com in coms: - com_name = com.xpath("string(.)") + if com.xpath("@parent-name"): + com_name = "{} {}".format( + com.xpath("@parent-name")[0], com.xpath("string(.)") + ) + else: + com_name = com.xpath("string(.)") com_name = f"House {com_name}" event.add_participant( com_name,