Skip to content

Commit 4618803

Browse files
Merge pull request #5693 from openstates/ky-events-handle-minutes-404
KY: events: allow skip of 404 on cmte minutes URL
2 parents e8e89fc + dc82e6c commit 4618803

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scrapers/ky/events.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import lxml
55
import pytz
66
import re
7+
from scrapelib import HTTPError
78

89
from openstates.scrape import Scraper, Event
910
from openstates.exceptions import EmptyScrape
@@ -137,7 +138,12 @@ def scrape_com_docs(self, url):
137138

138139
if page.xpath('//a[contains(text(), "Minutes")]/@href'):
139140
minutes_link = page.xpath('//a[contains(text(), "Minutes")]/@href')[0]
140-
docs["minutes"] = self.scrape_minutes(minutes_link)
141+
try:
142+
docs["minutes"] = self.scrape_minutes(minutes_link)
143+
except HTTPError as e:
144+
# At least one committee minutes link is 404 as of 6/9/26
145+
# So allowing this to skip as necessary
146+
self.warning(f"Failed to fetch committee minutes at {url}, error: {e}")
141147

142148
return docs
143149

0 commit comments

Comments
 (0)