From 61e3d92195341cf0b516f11254c2aa2e84cad97c Mon Sep 17 00:00:00 2001 From: showerst Date: Mon, 9 Dec 2024 11:14:52 -0500 Subject: [PATCH] MI: fix for committee sub without number (#5122) --- scrapers/mi/bills.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scrapers/mi/bills.py b/scrapers/mi/bills.py index 49c439933d..9a75f2eca9 100644 --- a/scrapers/mi/bills.py +++ b/scrapers/mi/bills.py @@ -108,7 +108,12 @@ def scrape_actions(self, bill: Bill, page: lxml.html.HtmlElement): if "substitute" in action.lower() and row.xpath("td[3]/a/@href"): version_url = row.xpath("td[3]/a/@href")[0] sub = re.search(r"\(.*?\)", action) - version_name = f"Substitute {sub.group(0)}" + + if sub: + version_name = f"Substitute {sub.group(0)}" + elif "committee of the whole" in action.lower(): + version_name = "Substitute, reported by Committee of the Whole" + if version_name in seen_subs: seen_subs[version_name] += 1 version_name = f"{version_name} - {seen_subs[version_name]}"