Skip to content

Commit

Permalink
fix(hawapp): skip record if docket cell has no <a> tag
Browse files Browse the repository at this point in the history
Solves: #871

Problem was a result row for hawapp where the docket cell had no <a> tag, causing an IndexError
  • Loading branch information
grossir committed Jan 25, 2024
1 parent 18a04f4 commit fd83ae4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions juriscraper/opinions/united_states/state/haw.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ def __init__(self, *args, **kwargs):
self.court_code = "S.Ct"
self.status = "Published"

def _process_html(self):
def _process_html(self) -> None:
"""Parse HTML into case objects
:return: None
"""
for row in self.html.xpath("//tr[@class='row-']"):
date, court, docket, name, lower_court, citation = row.xpath(
".//td"
)
name = name.text_content().split("(")[0]
court = court.text_content()
if court != self.court_code:
continue

if not docket.xpath(".//a"):
continue

name = name.text_content().split("(")[0]
self.cases.append(
{
"date": date.text_content(),
Expand Down

0 comments on commit fd83ae4

Please sign in to comment.