Skip to content

Commit

Permalink
Merge pull request #888 from grossir/fix_hawapp
Browse files Browse the repository at this point in the history
fix(hawapp): skip record if docket cell has no <a> tag
  • Loading branch information
flooie authored Jan 25, 2024
2 parents 18a04f4 + fd83ae4 commit 3521b18
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 3521b18

Please sign in to comment.