Repository: freelawproject/juriscraper (language: python)

Issue:
Maine Superior Court 
https://mainelaw.maine.edu/library/collections/superior-court-decisions/


Not sure if this is the right place, but we may want to add the Maine Superior Court sooner rather than later 
considering they just entered into the media frenzy from the primary

https://www.washingtonpost.com/politics/2023/12/28/maine-trump-primary-ballot/


Discussion / hints:

Fix patch:
diff --git a/juriscraper/opinions/united_states/state/__init__.py b/juriscraper/opinions/united_states/state/__init__.py
index f22fa9b95..ab847b94f 100644
--- a/juriscraper/opinions/united_states/state/__init__.py
+++ b/juriscraper/opinions/united_states/state/__init__.py
@@ -76,6 +76,7 @@
     # should be re-written to scrape CourtListener's API instead of the
     # court's website.
     # "me",
+    "mesuperct",
     "mich",
     "michctapp",
     "minn",
diff --git a/juriscraper/opinions/united_states/state/mesuperct.py b/juriscraper/opinions/united_states/state/mesuperct.py
new file mode 100644
index 000000000..9386ed7f9
--- /dev/null
+++ b/juriscraper/opinions/united_states/state/mesuperct.py
@@ -0,0 +1,57 @@
+"""Scraper for Superior Court of Maine
+CourtID: mesuperct
+Court Short Name: Me. Super Ct
+Author: William E. Palin
+Date created: December 28, 2023
+
+History:
+  2023-12-28: Created
+"""
+
+from datetime import date
+
+from juriscraper.OpinionSiteLinear import OpinionSiteLinear
+
+
+class Site(OpinionSiteLinear):
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.court_id = self.__module__
+        self.url = f"https://apps.maine.edu/SuperiorCourt/show_list.jsp?plaintiff=&defendant=&year={date.today().year}&code=&rule=&title=&number=&section=&Search=Search"
+        self.base_path = ["placeholder"]
+        self.back_scrape_iterable = [1]
+
+    def _download_backwards(self, d: date) -> None:
+        """Sets the URL for the backwards download based on the given date.
+
+        :param d: Just a placeholder value
+        :return: None
+        """
+        self.url = "https://apps.maine.edu/SuperiorCourt/show_list.jsp?plaintiff=&defendant=&year=&code=&rule=&title=&number=&section=&Search=Search"
+
+    def _process_html(self) -> None:
+        """Processes the HTML content and extracts case information.
+
+        Iterates over the rows of the HTML table, extracting case details and appending
+        them to the cases list as dictionaries.
+
+        :return: None
+        """
+
+        for row in self.html.xpath("//tr")[1:]:
+            docket_number = row.xpath(".//td//a/text()")[0].strip()
+            date = row.xpath(".//td/text()")[-1].strip()
+            plaintiff = row.xpath(".//td/a/text()")[1].strip()
+            defendant = row.xpath(".//td/a/text()")[2].strip()
+            url = f"https://files.mainelaw.maine.edu/library/SuperiorCourt/decisions/{docket_number}.pdf"
+            author = row.xpath(".//td/a/text()")[3].strip()
+            self.cases.append(
+                {
+                    "date": date,
+                    "docket": docket_number,
+                    "url": url,
+                    "name": f"{plaintiff} v. {defendant}",
+                    "status": "Unpublished",
+                    "judge": author,
+                }
+            )


Test patch:
diff --git a/tests/examples/opinions/united_states/mesuperct_example.compare.json b/tests/examples/opinions/united_states/mesuperct_example.compare.json
new file mode 100644
index 000000000..d2ab24027
--- /dev/null
+++ b/tests/examples/opinions/united_states/mesuperct_example.compare.json
@@ -0,0 +1,24 @@
+[
+  {
+    "case_dates": "2023-11-13",
+    "case_names": "McCarthy v. The Roman Catholic Bishop of Portland",
+    "download_urls": "https://files.mainelaw.maine.edu/library/SuperiorCourt/decisions/CUMbcd-cv-22-66.pdf",
+    "precedential_statuses": "Unpublished",
+    "blocked_statuses": false,
+    "date_filed_is_approximate": false,
+    "docket_numbers": "CUMbcd-cv-22-66",
+    "judges": "Thomas R.. McKeon",
+    "case_name_shorts": "McCarthy"
+  },
+  {
+    "case_dates": "2023-09-18",
+    "case_names": "Stewart v. University of Maine System",
+    "download_urls": "https://files.mainelaw.maine.edu/library/SuperiorCourt/decisions/CUMcv-20-537.pdf",
+    "precedential_statuses": "Unpublished",
+    "blocked_statuses": false,
+    "date_filed_is_approximate": false,
+    "docket_numbers": "CUMcv-20-537",
+    "judges": "Thomas R.. McKeon",
+    "case_name_shorts": "Stewart"
+  }
+]
\ No newline at end of file
diff --git a/tests/examples/opinions/united_states/mesuperct_example.html b/tests/examples/opinions/united_states/mesuperct_example.html
new file mode 100644
index 000000000..e11872361
--- /dev/null
+++ b/tests/examples/opinions/united_states/mesuperct_example.html
@@ -0,0 +1,50 @@
+<html><head>
+<title>Superior Court Database</title>
+<link rel="stylesheet" type="text/css" href="styles/style.css">
+
+<body id="body" onload="init();">
+
+
+<table class="sortable" width="100%" align="center" cellpadding="2">
+    <thead><tr bgcolor="82a4c6">
+		<th width="14%" align="center" bgcolor="82a4c6"><span class="style1">Docket#</span></th>
+		<th width="23%" bgcolor="82a4c6"><span class="style1">Plaintiff</span></th>
+		<th width="24%"><span class="style1">Defendant</span></th>
+		<th width="24%" bgcolor="82a4c6"><span class="style1">Judge<br>
+		County</span></th>
+		<th width="15%" bgcolor="82a4c6"><span class="style1">Decision
+		Date</span></th>
+	</tr></thead>
+	<tbody>
+
+	<tr class="odd">
+		<td><a href="show_detail.jsp?case_id=6501">
+		CUMbcd-cv-22-66</a></td>
+		<td><a href="show_list.jsp?participant=McCarthy"> McCarthy</a></td>
+		<td><a href="show_list.jsp?participant=The Roman Catholic Bishop of Portland"> The Roman Catholic Bishop of Portland</a></td>
+		<td><a href="show_list.jsp?judge_id=5847">
+		Thomas R.. McKeon</a> <br>
+		<a href="show_list.jsp?county_id=CUM"> Cumberland</a></td>
+		<td>2023-11-13</td>
+	</tr>
+
+	<tr class="even">
+		<td><a href="show_detail.jsp?case_id=6052">
+		CUMcv-20-537</a></td>
+		<td><a href="show_list.jsp?participant=Stewart"> Stewart</a></td>
+		<td><a href="show_list.jsp?participant=University of Maine System"> University of Maine System</a></td>
+		<td><a href="show_list.jsp?judge_id=5847">
+		Thomas R.. McKeon</a> <br>
+		<a href="show_list.jsp?county_id=CUM"> Cumberland</a></td>
+		<td>2023-09-18</td>
+	</tr>
+
+
+</tbody>
+</table>
+
+
+
+
+
+</body></html>
\ No newline at end of file