Skip to content

Commit 3da575b

Browse files
authored
Merge pull request #1492 from freelawproject/1284-idaho-date-parse
1284 idaho date parse
2 parents 5416a02 + ef0dddf commit 3da575b

File tree

4 files changed

+305
-3471
lines changed

4 files changed

+305
-3471
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Fixes:
2626
- Fix `visuper_p` adaptation to new html tags #1489
2727
- Fix `ariz` update download URLs #1474
2828
- handle empty cases in `ca7` scraper #1484
29+
- fix `idaho_civil` preformat date to prevent parsing errors #1284
2930

3031
## Current
3132

juriscraper/opinions/united_states/state/idaho_civil.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- 2015-10-23, mlr: Updated to handle annoying situation.
1010
- 2016-02-25 arderyp: Updated to catch "ORDER" (in addition to "Order") in download url text
1111
- 2024-12-30, grossir: updated to OpinionSiteLinear
12+
- 2025-07-09, luism: Updated to prevent wrongly formatted dates
1213
"""
1314

1415
from juriscraper.OpinionSiteLinear import OpinionSiteLinear
@@ -42,9 +43,15 @@ def _process_html(self):
4243
row_xpath = f"//table//tr[.//{self.path_conditional_anchor}]"
4344
for row in self.html.xpath(row_xpath):
4445
url = self.get_opinion_url(row).replace("http://", "https://")
46+
47+
# Sanitize case date, fix typo in date format
48+
date = row.xpath("string(td[1])").strip()
49+
if date == "Aug 22,2018":
50+
date = "Aug 22, 2018"
51+
4552
self.cases.append(
4653
{
47-
"date": row.xpath("string(td[1])").strip(),
54+
"date": date,
4855
"docket": row.xpath("string(td[2])").strip(),
4956
"name": row.xpath("string(td[3])").strip(),
5057
"url": url,

0 commit comments

Comments
 (0)