Skip to content

Commit

Permalink
Merge pull request #1242 from freelawproject/fix-ohio-ct-apps
Browse files Browse the repository at this point in the history
Fix ohio ct apps
  • Loading branch information
flooie authored Nov 18, 2024
2 parents ee14ecf + 33acc86 commit 153dd74
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 213 deletions.
16 changes: 13 additions & 3 deletions juriscraper/opinions/united_states/state/ohio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.court_index = 0
self.year = date.today().year
self.url = "https://www.supremecourtofohio.gov/rod/docs/"
self.url = f"https://www.supremecourt.ohio.gov/rod/docs/?HideTopicsAndIssuesColumn=False&Sort=&PageSize=50&Source={self.court_index}"
self.court_id = self.__module__

def _set_parameters(self) -> None:
"""Set the parameters for the search
:return: None
"""
event_validation = self.html.xpath("//input[@id='__EVENTVALIDATION']")
Expand All @@ -45,7 +46,10 @@ def _set_parameters(self) -> None:
self.method = "POST"

def _process_html(self) -> None:
"""Process the HTML and extract the data"""
"""Process the HTML and extract the data
:return: None
"""
if not self.test_mode_enabled():
self._set_parameters()
self.html = self._download()
Expand All @@ -57,7 +61,7 @@ def _process_html(self) -> None:
docket = row.xpath(".//td[2]//text()")[0].strip()
name = row.xpath(".//a/text()")[0]
if not docket:
logger.info("Skipping row with name '%s'", name)
logger.info("Skipping row with name '%s'", name.strip())
continue

judge = row.xpath(".//td[4]//text()")[0]
Expand Down Expand Up @@ -92,4 +96,10 @@ def _process_html(self) -> None:
# docket numbers, which may be repeated across districts
case["lower_court"] = f"{citation_or_county} County Court"

if (
f"https://www.supremecourt.ohio.gov/rod/docs/pdf/{self.court_index}/"
not in case["url"]
):
logger.warning("Wrong appellate page detected.")
continue
self.cases.append(case)
Loading

0 comments on commit 153dd74

Please sign in to comment.