diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..5e9af6a --- /dev/null +++ b/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + Projects + Scrapers + 1.0-SNAPSHOT + jar + + Scrapers + http://maven.apache.org + + + UTF-8 + 22 + 22 + + + + + + junit + junit + 3.8.1 + test + + + + + org.seleniumhq.selenium + selenium-java + 4.23.1 + + + + + com.google.code.gson + gson + 2.11.0 + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.3.0 + + + + + Projects.StartGUI + + + + jar-with-dependencies + + + + + package + + single + + + + + + + + \ No newline at end of file diff --git a/src/Projects/CourtScraper/DataManagement/CSV/CSVDownloadedAppend.java b/src/Projects/CourtScraper/DataManagement/CSV/CSVDownloadedAppend.java new file mode 100644 index 0000000..70cdfda --- /dev/null +++ b/src/Projects/CourtScraper/DataManagement/CSV/CSVDownloadedAppend.java @@ -0,0 +1,18 @@ +package CourtScraper.DataManagement.CSV; + +import java.io.FileWriter; +import java.io.IOException; + + +public class CSVDownloadedAppend { + + public static void appendToDownloaded(String row) throws IOException { + FileWriter csvFile = new FileWriter(CourtScraper.Helpers.CheckIfRetrieved.downloadedFilePath, true); + + csvFile.append("\n"); + csvFile.append(row); + + csvFile.flush(); + csvFile.close(); + } +} diff --git a/src/Projects/CourtScraper/DataManagement/CSV/CSVManagement.java b/src/Projects/CourtScraper/DataManagement/CSV/CSVManagement.java new file mode 100644 index 0000000..fbbbb9f --- /dev/null +++ b/src/Projects/CourtScraper/DataManagement/CSV/CSVManagement.java @@ -0,0 +1,38 @@ +package CourtScraper.DataManagement.CSV; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +public class CSVManagement { + + //path to be used for accessing temp file + + + public static void deleteLine(String tempFilePath, String tempFolderPath, String line) throws IOException { + File newTempFile = new File(tempFolderPath + "\\temp2temp.csv"); + newTempFile.createNewFile(); + File oldTempFile = new File(tempFilePath); + + FileWriter writer = new FileWriter(tempFolderPath + "\\temp2temp.csv"); + + List rows = Files.readAllLines(Path.of(tempFilePath)); + + for (String row : rows) { + if (row.equals(line)) { + continue; + } + writer.write(row + "\n"); + } + + writer.flush(); + writer.close(); + + oldTempFile.delete(); + newTempFile.renameTo(oldTempFile); + + } +} diff --git a/src/Projects/CourtScraper/DataManagement/CSV/CSVSearchAppendTemp.java b/src/Projects/CourtScraper/DataManagement/CSV/CSVSearchAppendTemp.java new file mode 100644 index 0000000..07e5e3d --- /dev/null +++ b/src/Projects/CourtScraper/DataManagement/CSV/CSVSearchAppendTemp.java @@ -0,0 +1,53 @@ +package CourtScraper.DataManagement.CSV; + +import java.io.FileWriter; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import static CourtScraper.Flows.Courtlink.CourtlinkSearchConfig.CourtlinkSearchConfigMain.processedInputs; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedCounty; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedState; + + +public class CSVSearchAppendTemp { + + public static String tempFilePath = "C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper\\States\\" + selectedState + "\\" + selectedCounty + "\\temp.csv"; + + //declarations of current date and time + private static SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + private Date date = new Date(); + + public void courtLinkAppendToTemp(List toBeAppended) throws IOException { + + String appendableString = ""; + + FileWriter csvFile = new FileWriter(tempFilePath, true); + + //adds case number and date of case filed from the courtlink site + for (String element : toBeAppended) { + appendableString += element.substring(1) + ","; + } + + //adds keywords used in search + appendableString += processedInputs[0] + ","; + //adds attorney terms used in search + appendableString += processedInputs[1] + ","; + //adds current date and time from which the document was grabbed from + appendableString += dateFormat.format(date) + ","; + //adds selected state + appendableString += selectedState + ","; + //added selected county + appendableString += selectedCounty + ","; + //adds documents selected + appendableString += "" + ","; + + + csvFile.append("\n"); + csvFile.append(appendableString.substring(0, appendableString.length() - 1)); + + csvFile.flush(); + csvFile.close(); + } +} diff --git a/src/Projects/CourtScraper/FlowStart.java b/src/Projects/CourtScraper/FlowStart.java new file mode 100644 index 0000000..cd8563e --- /dev/null +++ b/src/Projects/CourtScraper/FlowStart.java @@ -0,0 +1,23 @@ +package CourtScraper; + +import CourtScraper.Flows.Courtlink.CourtlinkMain; +import CourtScraper.Setups.Browser.Firefox; + +import java.io.IOException; + + + +public class FlowStart { + + public static void StartMainFlowButton() throws IOException, InterruptedException { + + new Firefox().FirefoxLaunch(); + new CourtlinkMain().CourtlinkFlow(); + + //closes all open tabs + CourtScraper.Helpers.TabManagement.closeAllTabs(); + + CourtScraper.Flows.States.StateParser.stateRetrievalFlow(); + + } +} diff --git a/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkMain.java b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkMain.java new file mode 100644 index 0000000..3c10003 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkMain.java @@ -0,0 +1,44 @@ +package CourtScraper.Flows.Courtlink; + +import CourtScraper.Flows.Courtlink.CourtlinkScraper.CourtlinkScrapeMain; +import CourtScraper.Helpers.ConfigGrabbers; +import CourtScraper.StartGUI; +import org.openqa.selenium.By; + +import java.io.FileNotFoundException; +import java.io.IOException; + + +import static CourtScraper.Flows.Courtlink.CourtlinkSearchConfig.CourtlinkSearchConfigMain.courtLinkTermInputs; + +public class CourtlinkMain { + + public void CourtlinkFlow() throws IOException, InterruptedException { + //Login process + courtLinkLogin(); + + Thread.sleep(1000); + + //inputs terms/dates into input boxes + courtLinkTermInputs(); + + Thread.sleep(1000); + + //scrapes courtlink for casenumbers + CourtlinkScrapeMain.courtLinkScrape(); + + + } + + + public static void courtLinkLogin() throws FileNotFoundException, InterruptedException { + StartGUI.driver.get("https://signin.lexisnexis.com/lnaccess/app/signin?back=https%3A%2F%2Fadvance.lexis.com%3A443%2Fcourtlinkhome&aci=la"); + String[] credentials = new ConfigGrabbers().loginGrabber("courtlink"); + + StartGUI.driver.findElement(By.xpath("//*[@id=\"userid\"]")).sendKeys(credentials[0]); + StartGUI.driver.findElement(By.xpath("//*[@id=\"signInSbmtBtn\"]")).click(); + Thread.sleep(1500); + StartGUI.driver.findElement(By.xpath("//*[@id=\"password\"]")).sendKeys(credentials[1]); + StartGUI.driver.findElement(By.xpath("//*[@id=\"signInSbmtBtn\"]")).click(); + } +} diff --git a/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkScraper/CourtlinkScrapeMain.java b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkScraper/CourtlinkScrapeMain.java new file mode 100644 index 0000000..753b8c1 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkScraper/CourtlinkScrapeMain.java @@ -0,0 +1,73 @@ +package CourtScraper.Flows.Courtlink.CourtlinkScraper; + +import CourtScraper.DataManagement.CSV.CSVSearchAppendTemp; +import CourtScraper.Flows.Courtlink.CourtlinkMain; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import java.io.IOException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; + +import static CourtScraper.StartGUI.driver; + + +public class CourtlinkScrapeMain extends CourtlinkMain { + + private static WebDriverWait wait; + private static int numCases = Integer.valueOf(driver.findElement(By.xpath("/html/body/main/div/main/div[2]/div/div[1]/div/div[1]/ul/li[1]")).getAttribute("data-actualresultscount")); + + public static void courtLinkScrape() throws IOException, InterruptedException { + wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + Thread.sleep(500); + System.out.println(numCases); + driver.findElement(By.xpath("//*[@id=\"title_sr0\"]")).click(); + //waits until first page is loaded + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id=\"Header\"]"))); + + //Grabs Case Info + for (int i = numCases-1; !(i == 0); i--) { + //grabs info on page + new CourtlinkScrapeMain().grabCaseInfo(); + Thread.sleep(2000); + + //grabs url for later next page loaded check + String url = driver.getCurrentUrl(); + + //clicks next button to move on to the next case + driver.findElement(By.xpath("/html/body/main/div/main/div/form/div[1]/div[1]/ul[3]/li/button[2]/span[1]")).click(); + + //ends if on last page to prevent stoppage and grabs last case before stopping + if (i==1) { + new CourtlinkScrapeMain().grabCaseInfo(); + Thread.sleep(2000); + break; + } + //waits until next page loaded + wait.until(ExpectedConditions.not(ExpectedConditions.urlToBe(url))); + Thread.sleep(500); + + + } + } + + public void grabCaseInfo() throws IOException { + List toBeAppended = new ArrayList<>(); + + //inner text retrieves text not html from the inside and splits it + + String caseInfo = driver.findElement(By.xpath("//*[@id=\"Header\"]")).getAttribute("innerText"); + String[] info = caseInfo.split("\n"); + + //adds the case number and date filed in a loop + for (int i = 1; i<3; i++) { + String[] elements = info[i].split(":", 2); + toBeAppended.add(elements[1].trim()); + } + //adds them to temporary csv file + new CSVSearchAppendTemp().courtLinkAppendToTemp(toBeAppended); + + } +} \ No newline at end of file diff --git a/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkSearchConfig/CourtlinkSearchConfigMain.java b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkSearchConfig/CourtlinkSearchConfigMain.java new file mode 100644 index 0000000..77bc663 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkSearchConfig/CourtlinkSearchConfigMain.java @@ -0,0 +1,97 @@ +package CourtScraper.Flows.Courtlink.CourtlinkSearchConfig; + + +import CourtScraper.Flows.Courtlink.CourtlinkMain; +import CourtScraper.Helpers.ProcessInputs; +import CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes; +import CourtScraper.StartGUI; +import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.Select; + + +public class CourtlinkSearchConfigMain extends CourtlinkMain { + + public static String[] processedInputs; + + private static WebElement dateBox; + + public static void courtLinkTermInputs() throws InterruptedException { + + Thread.sleep(1000); + + processedInputs = new ProcessInputs().grabInputs(); + + //enter search terms + courtLinkSearchTerms(); + + //enter attorney name + courtLinkAttorneyName(); + + //select state + courtLinkStateSelection(); + + //select date + courtLinkDateInput(); + + Thread.sleep(1000); + + StartGUI.driver.findElement(By.xpath("//button[@id='triggersearch']")).click(); + } + + public static void courtLinkSearchTerms() throws InterruptedException { + StartGUI.driver.findElement(By.xpath("//input[@name='keywords']")).sendKeys(processedInputs[0]); + Thread.sleep(1000); + + } + + public static void courtLinkAttorneyName() throws InterruptedException { + StartGUI.driver.findElement(By.cssSelector("div.controls-container:nth-child(1) > div:nth-child(5) > filteredtextbox:nth-child(1) > div:nth-child(1) > fieldset:nth-child(1) > div:nth-child(2) > div:nth-child(1) > input:nth-child(1)")).sendKeys(processedInputs[1]); + Thread.sleep(1000); + } + + public static void courtLinkStateSelection() throws InterruptedException { + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/div[1]/courtlist/div/courtlistselector/div/div[1]/span[1]/div")).click(); + StateSearchSelection.searchState(MainComboBoxes.selectedState); + Thread.sleep(1000); + } + + public static void courtLinkDateInput() throws InterruptedException { + //scroll into view + ((JavascriptExecutor) StartGUI.driver).executeScript("arguments[0].scrollIntoView(true);", StartGUI.driver.findElement(By.cssSelector("div.courtlinkdateselection-container"))); + Thread.sleep(1000); + + + //select the date type + Select dropdown = new Select(StartGUI.driver.findElement(By.xpath("//select"))); + dropdown.selectByVisibleText(MainComboBoxes.selectedDateType); + + Thread.sleep(1000); + switch (MainComboBoxes.selectedDateType) { + case "All available dates": + return; + case "Date is": + case "Date is before": + case "Date is after": + dateBox = StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/segmentcontrols/div[1]/div[8]/dateselector/div/div[2]/div[2]/div/div/datepicker/div/input")); + String date = processedInputs[2]; + String js = String.format("arguments[0].value = '%s';", date); + StartGUI.driver.findElement(By.xpath("//input[@aria-label='Enter the date']")).sendKeys(processedInputs[2]); + ((JavascriptExecutor) StartGUI.driver).executeScript(js, dateBox); + break; + case "Date is between": + dateBox = StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/segmentcontrols/div[1]/div[8]/dateselector/div/div[2]/div[2]/div/div/datepicker/div/input")); + ((JavascriptExecutor) StartGUI.driver).executeScript("arguments[0].value = '';", dateBox); + Thread.sleep(500); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/segmentcontrols/div[1]/div[8]/dateselector/div/div[2]/div[2]/div[1]/div[2]/datepicker/div/input")).sendKeys(processedInputs[2]); + Thread.sleep(1000); + dateBox = StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/segmentcontrols/div[1]/div[8]/dateselector/div/div[2]/div[2]/div[2]/div[2]/datepicker/div/input")); + ((JavascriptExecutor) StartGUI.driver).executeScript("arguments[0].value = '';", dateBox); + Thread.sleep(500); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/segmentcontrols/div[1]/div[8]/dateselector/div/div[2]/div[2]/div[2]/div[2]/datepicker/div/input")).sendKeys(processedInputs[3]); + break; + } + } + +} diff --git a/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkSearchConfig/StateSearchSelection.java b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkSearchConfig/StateSearchSelection.java new file mode 100644 index 0000000..18fd1b5 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/Courtlink/CourtlinkSearchConfig/StateSearchSelection.java @@ -0,0 +1,41 @@ +package CourtScraper.Flows.Courtlink.CourtlinkSearchConfig; + +import CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes; +import CourtScraper.StartGUI; +import org.openqa.selenium.By; + +public class StateSearchSelection extends CourtlinkSearchConfigMain { + + public static void searchState(String state) throws InterruptedException { + switch (state) { + case "California": + StartGUI.driver.findElement(By.xpath("//*[@id=\"courtsdropdown\"]")).sendKeys("California " + MainComboBoxes.selectedCounty); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/div[1]/courtlist/div/courtlistselector/div/div[2]/div/div[2]/div/div/div/div/label/div")).click(); + break; + case "Florida": + StartGUI.driver.findElement(By.xpath("//*[@id=\"courtsdropdown\"]")).sendKeys("Florida " + MainComboBoxes.selectedCounty); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/div[1]/courtlist/div/courtlistselector/div/div[2]/div/div[2]/div/div/div/div/label/div")).click(); + break; + case "New York": + if (MainComboBoxes.selectedCounty.equals("New York BKQ")) { + String[] BKQ = {"Bronx", "Kings", "Queens"}; + for (String burrough : BKQ) { + StartGUI.driver.findElement(By.xpath("//*[@id=\"courtsdropdown\"]")).sendKeys("New York " + burrough); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/div[1]/courtlist/div/courtlistselector/div/div[2]/div/div[2]/div/div/div/div/label/div")).click(); + StartGUI.driver.findElement(By.xpath("//*[@id=\"courtsdropdown\"]")).clear(); + } + } else { + StartGUI.driver.findElement(By.xpath("//*[@id=\"courtsdropdown\"]")).sendKeys("New York " + MainComboBoxes.selectedCounty); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/div[1]/courtlist/div/courtlistselector/div/div[2]/div/div[2]/div/div/div/div/label/div")).click(); + } + break; + case "Texas": + StartGUI.driver.findElement(By.xpath("//*[@id=\"courtsdropdown\"]")).sendKeys("Texas " + MainComboBoxes.selectedCounty + " district"); + Thread.sleep(1000); + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/div[1]/courtlist/div/courtlistselector/div/div[2]/div/div[2]/div/div/div/div/label/div")).click(); + Thread.sleep(1000); + break; + } + StartGUI.driver.findElement(By.xpath("/html/body/main/div/ln-courtlinksearchform/div/searchform/div[1]/segmentcontrols/div[1]/div[1]/div[2]/input")).click(); + } +} diff --git a/src/Projects/CourtScraper/Flows/States/StateParser.java b/src/Projects/CourtScraper/Flows/States/StateParser.java new file mode 100644 index 0000000..9240c5f --- /dev/null +++ b/src/Projects/CourtScraper/Flows/States/StateParser.java @@ -0,0 +1,69 @@ +package CourtScraper.Flows.States; + + +import CourtScraper.DataManagement.CSV.CSVDownloadedAppend; +import CourtScraper.FlowStart; +import CourtScraper.Helpers.CheckIfRetrieved; +import CourtScraper.Helpers.FileManagement; + +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import static CourtScraper.DataManagement.CSV.CSVManagement.deleteLine; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedCounty; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedState; + + +public class StateParser extends FlowStart { + + //file location of the temp file that is used to store data + public static String tempFolderPath = "C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper\\States\\" + selectedState + "\\" + selectedCounty; + + //docket names and numbers for renaming purposes + public static List docketNumbers; + public static List docketNames; + + + public static void stateRetrievalFlow() throws IOException, InterruptedException { + //declares lists for docket names and docket numbers + + //declares list containing lines from temp file. + List tempLines = Files.readAllLines(Path.of(CourtScraper.DataManagement.CSV.CSVSearchAppendTemp.tempFilePath)); + //parses through the current temp file skipping the first line + for (int i = 1; i<=tempLines.size()-1; i++) { + docketNames = new ArrayList<>(); + docketNumbers = new ArrayList<>(); + + String[] caseLine = tempLines.get(i).split(","); + + //deletes the line from temp if it found a duplicate and skips retrieval + if ((CheckIfRetrieved.caseRepeatedCheck(caseLine[0])) || (caseLine[0].isEmpty())) { + deleteLine(CourtScraper.DataManagement.CSV.CSVSearchAppendTemp.tempFilePath, tempFolderPath, tempLines.get(i)); + continue; + } + + //grabs case files + StateSelect.stateFilter(caseLine[0]); + + //moves case number folder to downloaded folder + FileManagement.tempFileMove(caseLine[0]); + + //adds line to downloads folder + CSVDownloadedAppend.appendToDownloaded(tempLines.get(i)); + + //deletes line from temp folder + deleteLine(CourtScraper.DataManagement.CSV.CSVSearchAppendTemp.tempFilePath, tempFolderPath, tempLines.get(i)); + + + } + } + + public static void renameFilesBulk() { + for (int i = 0; i < docketNames.size(); i++) { + FileManagement.tempFileRename(docketNumbers.get(i), docketNames.get(i)); + } + } +} diff --git a/src/Projects/CourtScraper/Flows/States/StateSelect.java b/src/Projects/CourtScraper/Flows/States/StateSelect.java new file mode 100644 index 0000000..5d9c993 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/States/StateSelect.java @@ -0,0 +1,35 @@ +package CourtScraper.Flows.States; + + +import CourtScraper.Flows.States.Texas.Dallas.DallasCounty; + +import java.io.FileNotFoundException; + +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedCounty; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedState; + +public class StateSelect extends StateParser { + + public static void stateFilter(String caseNumber) throws FileNotFoundException, InterruptedException { + Thread.sleep(500); + switch (selectedState) { + case "California": + if (selectedCounty.equals("Whole State")) { + } + case "Florida": + if (selectedCounty.equals("Miami-Dade")) { + } + case "New York": + if (selectedCounty.equals("New York BKQ")) { + } + case "Texas": + if (selectedCounty.equals("Harris")) { + CourtScraper.Flows.States.Texas.Harris.HarrisCounty.harrisMain(caseNumber); + } else if (selectedCounty.equals("Dallas")) { + new DallasCounty().dallasMain(); + } + + } + } + +} diff --git a/src/Projects/CourtScraper/Flows/States/Texas/Dallas/DallasCounty.java b/src/Projects/CourtScraper/Flows/States/Texas/Dallas/DallasCounty.java new file mode 100644 index 0000000..166e893 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/States/Texas/Dallas/DallasCounty.java @@ -0,0 +1,7 @@ +package CourtScraper.Flows.States.Texas.Dallas; + +public class DallasCounty { + + public void dallasMain() { + } +} diff --git a/src/Projects/CourtScraper/Flows/States/Texas/Harris/HarrisCounty.java b/src/Projects/CourtScraper/Flows/States/Texas/Harris/HarrisCounty.java new file mode 100644 index 0000000..5658989 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/States/Texas/Harris/HarrisCounty.java @@ -0,0 +1,74 @@ +package CourtScraper.Flows.States.Texas.Harris; + +import CourtScraper.Flows.States.StateSelect; +import CourtScraper.Helpers.ConfigGrabbers; +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import java.io.FileNotFoundException; +import java.time.Duration; + +import static CourtScraper.Helpers.TabManagement.switchTab; +import static CourtScraper.StartGUI.driver; + + +public class HarrisCounty extends StateSelect { + + private static WebDriverWait wait; + + public static void harrisMain(String caseNumber) throws FileNotFoundException, InterruptedException { + wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + //grabs harris site and logs in only if reset has recently happened + if (driver.getCurrentUrl().equals("https://www.google.com/")) { + loginHarris(); + } + + wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='txtCaseNumber']"))).sendKeys(caseNumber); + //driver.findElement(By.xpath("//*[@id='txtCaseNumber']")).sendKeys(caseNumber); + + Thread.sleep(3000); + + try { + while (!driver.findElement(By.className("captcha-solver")).getAttribute("data-state").equals("solved")) { + Thread.sleep(1); + } + } catch (NoSuchElementException e) { + System.out.println("no captcha"); + } + + Thread.sleep(500); + driver.findElement(By.cssSelector("#ctl00_ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder2_ContentPlaceHolder2_btnCivSearch")).click(); + Thread.sleep(1500); + driver.findElement(By.xpath("//a[@title='View Case Details']")).click(); + Thread.sleep(2000); + + switchTab(1); + + driver.findElement(By.xpath("//*[@id=\"tabDocuments\"]")).click(); + + new HarrisDocketRetrieval().retrieveDockets(); + + driver.close(); + switchTab(0); + + driver.findElement(By.xpath("//*[@id=\"ctl00_ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder2_ContentPlaceHolder2_btnSearchAgain\"]")).click(); + + //renames case files + renameFilesBulk(); + } + + public static void loginHarris() throws InterruptedException, FileNotFoundException { + driver.get("https://www.hcdistrictclerk.com/eDocs/Public/Search.aspx"); + String[] credentials = new ConfigGrabbers().loginGrabber("texasharris"); + + Thread.sleep(500); + driver.findElement(By.xpath("//*[@id='txtUserName']")).sendKeys(credentials[0]); + Thread.sleep(500); + driver.findElement(By.xpath("//*[@id='txtPassword']")).sendKeys(credentials[1]); + Thread.sleep(500); + driver.findElement(By.xpath("//*[@id='btnLogin']")).click(); + Thread.sleep(500); + } +} \ No newline at end of file diff --git a/src/Projects/CourtScraper/Flows/States/Texas/Harris/HarrisDocketRetrieval.java b/src/Projects/CourtScraper/Flows/States/Texas/Harris/HarrisDocketRetrieval.java new file mode 100644 index 0000000..f0006a3 --- /dev/null +++ b/src/Projects/CourtScraper/Flows/States/Texas/Harris/HarrisDocketRetrieval.java @@ -0,0 +1,41 @@ +package CourtScraper.Flows.States.Texas.Harris; + +import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.WebElement; + +import java.util.List; + +import static CourtScraper.Flows.States.StateParser.docketNames; +import static CourtScraper.Flows.States.StateParser.docketNumbers; +import static CourtScraper.Helpers.TabManagement.closeLastOpened; +import static CourtScraper.StartGUI.driver; + +public class HarrisDocketRetrieval extends CourtScraper.Flows.States.Texas.Harris.HarrisCounty { + + + public void retrieveDockets() throws InterruptedException { + + List rows = driver.findElements(By.xpath("/html/body/form/div[3]/div/div/div/div[3]/div[15]/div/section/div/div/div[3]/table/tbody/tr")); + int count = 0; + for (WebElement element : rows) { + count++; + if (element.getAttribute("outerHTML").contains(">Order<") || count <= 5) { + //finds anchor for the link to click and download + WebElement link = element.findElement(By.xpath(".//a")); + //grabs name of document for renaming purposes + docketNames.add(element.findElement(By.xpath("./td/table/tbody/tr/td[1]")).getAttribute("innerHTML").replace("\n", " ").replace(",", "").replace("\u00A0", "").replace("/", " ").replace("\"", " ").trim()); + //grabs docket number for renaming and puts them on a list for later use + docketNumbers.add(link.getText()); + ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", link); + link.click(); + + + Thread.sleep(5000); + closeLastOpened(); + + + } + } + } +} diff --git a/src/Projects/CourtScraper/Helpers/CheckIfRetrieved.java b/src/Projects/CourtScraper/Helpers/CheckIfRetrieved.java new file mode 100644 index 0000000..238f2c1 --- /dev/null +++ b/src/Projects/CourtScraper/Helpers/CheckIfRetrieved.java @@ -0,0 +1,27 @@ +package CourtScraper.Helpers; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedCounty; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedState; + +public class CheckIfRetrieved { + + public static String downloadedFilePath = "C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper\\States\\" + selectedState + "\\" + selectedCounty + "\\downloadedtest.csv"; + + public static boolean caseRepeatedCheck(String caseNumber) throws IOException { + List downloadedList = Files.readAllLines(Path.of(downloadedFilePath)); + + //goes through the downloaded cases list to check skipping the first line + for (int i = 1; i<=downloadedList.size()-1; i++) { + String[] row = downloadedList.get(i).split(","); + if (row[0].equals(caseNumber)) { + return true; + } + } + return false; + } +} diff --git a/src/Projects/CourtScraper/Helpers/ConfigGrabbers.java b/src/Projects/CourtScraper/Helpers/ConfigGrabbers.java new file mode 100644 index 0000000..7bef713 --- /dev/null +++ b/src/Projects/CourtScraper/Helpers/ConfigGrabbers.java @@ -0,0 +1,41 @@ +package CourtScraper.Helpers; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.stream.JsonReader; + +import java.io.FileNotFoundException; +import java.io.FileReader; + +public class ConfigGrabbers { + + //This helper class is for grabbing any data in configs + + private static Gson gson = new Gson(); + + public String[] loginGrabber(String website) throws FileNotFoundException { + + //Defining Array with login credentials + String[] loginCreds; + + //Opening File and reading the file as Json + JsonReader reader = new JsonReader(new FileReader("C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper\\Configs\\logins.json")); + JsonObject logins = gson.fromJson(reader, JsonObject.class); + + for (JsonElement element : logins.get("credentials").getAsJsonArray()) { + //finds credentials matching input + if (element.getAsJsonObject().get("ID").getAsString().equals(website)) { + + //grabs username and passwords and puts them in an array + String username = element.getAsJsonObject().get("username").getAsString(); + String password = element.getAsJsonObject().get("password").getAsString(); + loginCreds = new String[]{username, password}; + return loginCreds; + } + + } + return loginCreds = new String[]{null}; + } +} diff --git a/src/Projects/CourtScraper/Helpers/FileManagement.java b/src/Projects/CourtScraper/Helpers/FileManagement.java new file mode 100644 index 0000000..48161cd --- /dev/null +++ b/src/Projects/CourtScraper/Helpers/FileManagement.java @@ -0,0 +1,31 @@ +package CourtScraper.Helpers; + +import java.io.File; + +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedCounty; +import static CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.selectedState; + +public class FileManagement { + + //folder paths + private static String downloadedFolderPath = "C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper\\States\\" + selectedState + "\\" + selectedCounty + "\\Downloaded"; + private static String tempFolderPath = "C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper\\Temp"; + private static String tempFolderLocationPath = "C:\\Users\\" + System.getenv("USERNAME") + "\\Desktop\\Courtlink Scraper"; + + public static void tempFileMove(String caseNumber) throws InterruptedException { + File oldFolder = new File(tempFolderPath); + + //moves and renames + oldFolder.renameTo(new File(downloadedFolderPath + "\\" + caseNumber)); + new File(tempFolderLocationPath + "\\Temp").mkdir(); + + Thread.sleep(500); + + } + + public static void tempFileRename(String originalName, String newName) { + File oldNamedFolder = new File(tempFolderPath + "\\" + originalName + ".pdf"); + + oldNamedFolder.renameTo(new File(tempFolderPath + "\\" + newName + ".pdf")); + } +} diff --git a/src/Projects/CourtScraper/Helpers/ProcessInputs.java b/src/Projects/CourtScraper/Helpers/ProcessInputs.java new file mode 100644 index 0000000..3ab0dc3 --- /dev/null +++ b/src/Projects/CourtScraper/Helpers/ProcessInputs.java @@ -0,0 +1,51 @@ +package CourtScraper.Helpers; + + +import CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes; +import CourtScraper.Setups.GUI.MainPanelElements.MainInputBoxes; + +public class ProcessInputs { + + //This Helper class is for grabbing the inputs from the search box and combo boxes on the interface to then be processed into usable variables throughout the code + + + private static String startDate = ""; + private static String endDate = ""; + + public String[] grabInputs() { + + //Runs getDateBox() to get the dates inputed into the fixed variables above + getDateBox(); + + + + String[] inputs = {getSearchBox(), getAttorneyBox(), startDate, endDate, getState(), getCounty()}; + return inputs; + } + + public static String getSearchBox() { + return MainInputBoxes.search.getText(); + } + + public static String getAttorneyBox() { + return MainInputBoxes.attorney.getText(); + } + + public static void getDateBox() { + String[] reformattedDates = MainInputBoxes.date.getText().replaceAll("[^0-9/-]", "").split("-"); + if (reformattedDates.length > 1) { + startDate = reformattedDates[0]; + endDate = reformattedDates[1]; + } else { + startDate = reformattedDates[0]; + } + } + + public static String getState() { + return MainComboBoxes.selectedState; + } + + public static String getCounty() { + return MainComboBoxes.selectedCounty; + } +} diff --git a/src/Projects/CourtScraper/Helpers/TabManagement.java b/src/Projects/CourtScraper/Helpers/TabManagement.java new file mode 100644 index 0000000..38de889 --- /dev/null +++ b/src/Projects/CourtScraper/Helpers/TabManagement.java @@ -0,0 +1,44 @@ +package CourtScraper.Helpers; + +import org.openqa.selenium.JavascriptExecutor; + +import java.util.ArrayList; +import java.util.Set; + +import static CourtScraper.StartGUI.driver; + + +public class TabManagement { + + public static void closeAllTabs() throws InterruptedException { + Set tabs = driver.getWindowHandles(); + ((JavascriptExecutor) driver).executeScript("window.open('https://www.google.com');"); + for (String tab : tabs) { + driver.switchTo().window(tab); + driver.close(); + + } + switchTab(0); + } + + public static void switchTab(int tabSpot) { + Set tabs = driver.getWindowHandles(); + + int count = 0; + for (String tab : tabs) { + if (count == tabSpot) { + driver.switchTo().window(tab); + break; + } + count++; + } + } + + public static void closeLastOpened() { + String currentTab = driver.getWindowHandle(); + int numOfTabs = driver.getWindowHandles().size(); + switchTab(numOfTabs-1); + driver.close(); + driver.switchTo().window(currentTab); + } +} diff --git a/src/Projects/CourtScraper/Setups/Browser/Firefox.java b/src/Projects/CourtScraper/Setups/Browser/Firefox.java new file mode 100644 index 0000000..051046e --- /dev/null +++ b/src/Projects/CourtScraper/Setups/Browser/Firefox.java @@ -0,0 +1,24 @@ +package CourtScraper.Setups.Browser; + +import CourtScraper.StartGUI; +import org.openqa.selenium.firefox.*; + +public class Firefox extends StartGUI { + + public void FirefoxLaunch() { + + //System.setProperty("webdriver.gecko.driver", firefoxPath); + + ProfilesIni profileIni = new ProfilesIni(); + FirefoxProfile profile = profileIni.getProfile("BOT RUN"); + FirefoxOptions options = new FirefoxOptions(); + + options.setProfile(profile); + + //options.setCapability("marionette", true); + //options.addArguments("--headless"); + + driver = new FirefoxDriver(options); + driver.get("https://www.google.com/"); + } +} diff --git a/src/Projects/CourtScraper/Setups/GUI/Interface.java b/src/Projects/CourtScraper/Setups/GUI/Interface.java new file mode 100644 index 0000000..b28a893 --- /dev/null +++ b/src/Projects/CourtScraper/Setups/GUI/Interface.java @@ -0,0 +1,47 @@ +package CourtScraper.Setups.GUI; + +import CourtScraper.Setups.GUI.MainPanelElements.MainButtons; + +import javax.swing.*; +import java.awt.*; + + +public class Interface { + + private static JFrame frame = new JFrame(); + + public static void mainGUI() throws InterruptedException { + + panelSetups(); + + //put panel elements above here + + frameSetup(); + //put frame elements above here but below panel + + MainButtons.isClicked(); + //put all waiting or conditional elements above here but below frames + + } + + public static void panelSetups() throws InterruptedException { + + //panel setup + CourtScraper.Setups.GUI.Panels.mainPanel(); + //panel setup + } + + public static void frameSetup() { + //frame setup + frame.add(Panels.mainPanel, BorderLayout.CENTER); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setTitle("My Scraper"); + frame.setLayout(new FlowLayout()); + frame.pack(); + frame.setVisible(true); + //frame setup + } + + + +} diff --git a/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainButtons.java b/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainButtons.java new file mode 100644 index 0000000..750ae0d --- /dev/null +++ b/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainButtons.java @@ -0,0 +1,74 @@ +package CourtScraper.Setups.GUI.MainPanelElements; + +import CourtScraper.Setups.GUI.Panels; + +import javax.swing.*; + +import static CourtScraper.FlowStart.StartMainFlowButton; +import static CourtScraper.Setups.GUI.Panels.gbcMain; +import static CourtScraper.Setups.GUI.Panels.mainPanel; + +public class MainButtons extends Panels { + +//Main Panel Buttons + + public static void mainPanelButtons() throws InterruptedException { + startButton(); + } + + + //startButton declarations + private static JButton start; + + //start button for mainPanel to start flow + public static void startButton() throws InterruptedException { + //button intialization + + start = new JButton("Start"); + + gbcMain.gridx = 0; + gbcMain.gridy = 100; + mainPanel.add(start, gbcMain); + + //clicked action reader AND STARTS FLOW + start.addActionListener(e -> { + clicked = true; + SwingWorker startLooper = new SwingWorker<>() { + @Override + protected Void doInBackground() throws Exception { + start.setEnabled(false); + start.setText("Started"); + + + //FLOW START vvvv + StartMainFlowButton(); + System.out.println("Ended"); + //FLOW START ^^^^ + + + start.setEnabled(true); + start.setText("Start"); + + return null; + } + + }; + startLooper.execute(); + }); + +} + + //isClicked declarations + public static boolean clicked = false; + + public static void isClicked() throws InterruptedException { + while (!clicked) { + Thread.sleep(1); + } + //start.setEnabled(false); + //start.setText("Running"); + } + + +//Main Panel Buttons +} diff --git a/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainComboBoxes.java b/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainComboBoxes.java new file mode 100644 index 0000000..5511caa --- /dev/null +++ b/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainComboBoxes.java @@ -0,0 +1,147 @@ +package CourtScraper.Setups.GUI.MainPanelElements; + +import CourtScraper.Setups.GUI.Panels; + +import javax.swing.*; + + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +import static CourtScraper.Setups.GUI.MainPanelElements.MainInputBoxes.date; + + +public class MainComboBoxes extends Panels { + +//Main Panel Combo Boxes + public static void mainPanelComboBoxes() { + setDateType(); + setState(); + setCounty(); + + } + + //Date Boxes + //Date type declarations + private static final String[] dateTypeElements = {"All available dates", "Date is", "Date is before", "Date is after", "Date is between"}; + public static JComboBox dateType = new JComboBox<>(dateTypeElements); + public static String selectedDateType = "All available dates"; + private static JLabel dateLabel; + + public static void setDateType() { + gbcMain.gridx = 0; + gbcMain.gridy = 8; + dateLabel = new JLabel("MM/DD/YYYY"); + mainPanel.add(dateLabel, gbcMain); + + gbcMain.gridx = 0; + gbcMain.gridy = 9; + mainPanel.add(dateType, gbcMain); + + //Listener for Date instruction label + dateType.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + + selectedDateType = (String) dateType.getSelectedItem(); + if (dateType.getSelectedItem() == "All available dates") { + date.setEditable(false); + } else if (dateType.getSelectedItem() == "Date is between") { + date.setEditable(true); + dateLabel.setText("MM/DD/YYYY - MM/DD/YYYY"); + } else { + date.setEditable(true); + dateLabel.setText("MM/DD/YYYY"); + } + } + } + }); + + } + + //State Boxes + //State type declarations + private static final String[] stateElements = {"Select State", "California", "Florida", "New York", "Texas"}; + public static JComboBox state = new JComboBox<>(stateElements); + public static String selectedState = ""; + + public static void setState() { + JLabel instruction = new JLabel("Select State"); + + gbcMain.gridx = 0; + gbcMain.gridy = 0; + mainPanel.add(instruction, gbcMain); + + gbcMain.gridx = 0; + gbcMain.gridy = 1; + mainPanel.add(state, gbcMain); + + //Listener for County Combo Box selection + state.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + selectedState = (String) state.getSelectedItem(); + + switch(selectedState) { + case "California": + counties.removeAllItems(); + counties.addItem("Whole State"); + break; + case "Florida": + counties.removeAllItems(); + counties.addItem("Miami-Dade"); + break; + case "New York": + counties.removeAllItems(); + counties.addItem("New York BKQ"); + break; + case "Texas": + counties.removeAllItems(); + counties.addItem("Harris"); + counties.addItem("Dallas"); + } + counties.setEnabled(true); + + } + } + }); + + + } + + //County Box + //County type declarations + private static String[] countyElements = {"Select State First"}; + public static JComboBox counties = new JComboBox<>(countyElements); + public static String selectedCounty = ""; + + public static void setCounty() { + JLabel instruction = new JLabel("Select County"); + + gbcMain.gridx = 1; + gbcMain.gridy = 0; + mainPanel.add(instruction, gbcMain); + + counties.setEnabled(false); + + gbcMain.gridx = 1; + gbcMain.gridy = 1; + mainPanel.add(counties, gbcMain); + + //Listening to grab input for county + counties.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + selectedCounty = (String) counties.getSelectedItem(); + } + } + }); + } + +//Main Panel Combo Boxes + + +} diff --git a/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainInputBoxes.java b/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainInputBoxes.java new file mode 100644 index 0000000..88f2fd1 --- /dev/null +++ b/src/Projects/CourtScraper/Setups/GUI/MainPanelElements/MainInputBoxes.java @@ -0,0 +1,64 @@ +package CourtScraper.Setups.GUI.MainPanelElements; + +import CourtScraper.Setups.GUI.Panels; + +import javax.swing.*; + +public class MainInputBoxes extends Panels { + +//mainPanel variables + //declarations are public so they can be grabbed + public static JTextField search; + public static JTextField attorney; + public static JTextField date; + +//mainPanel Boxes + public static void mainPanelBoxes() { + searchBox(); + attorneyBox(); + dateBox(); + } + + public static void searchBox() { + JLabel instruction = new JLabel("Search Terms"); + search = new JTextField(15); + + Panels.gbcMain.gridx = 0; + Panels.gbcMain.gridy = 2; + Panels.mainPanel.add(instruction, Panels.gbcMain); + + Panels.gbcMain.gridx = 0; + Panels.gbcMain.gridy = 3; + Panels.gbcMain.gridwidth = 2; + Panels.mainPanel.add(search, Panels.gbcMain); + } + + public static void attorneyBox() { + JLabel instruction = new JLabel("Attorney Search Terms"); + attorney = new JTextField(); + + Panels.gbcMain.gridx = 0; + Panels.gbcMain.gridy = 6; + Panels.mainPanel.add(instruction, Panels.gbcMain); + + Panels.gbcMain.gridx = 0; + Panels.gbcMain.gridy = 7; + Panels.gbcMain.gridwidth = 2; + Panels.mainPanel.add(attorney, Panels.gbcMain); + + } + + public static void dateBox() { + date = new JTextField(); + + Panels.gbcMain.gridx = 1; + Panels.gbcMain.gridy = 9; + Panels.gbcMain.gridwidth = 1; + Panels.mainPanel.add(date, Panels.gbcMain); + + date.setEditable(false); + } + + +//mainPanel Boxes +} diff --git a/src/Projects/CourtScraper/Setups/GUI/Panels.java b/src/Projects/CourtScraper/Setups/GUI/Panels.java new file mode 100644 index 0000000..2e963c5 --- /dev/null +++ b/src/Projects/CourtScraper/Setups/GUI/Panels.java @@ -0,0 +1,32 @@ +package CourtScraper.Setups.GUI; + +import CourtScraper.Setups.GUI.MainPanelElements.MainButtons; + +import javax.swing.*; +import java.awt.*; + +import static CourtScraper.Setups.GUI.MainPanelElements.MainInputBoxes.mainPanelBoxes; + +public class Panels { + + public static JPanel mainPanel = new JPanel(); + public static GridBagConstraints gbcMain = new GridBagConstraints(); + + public static void mainPanel() throws InterruptedException { + //borders around edges + mainPanel.setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30)); + //borders around edges + + + mainPanel.setLayout(new GridBagLayout()); + + gbcMain.fill = GridBagConstraints.BOTH; + gbcMain.insets = new Insets(5, 5, 5, 5); + + + + mainPanelBoxes(); + MainButtons.mainPanelButtons(); + CourtScraper.Setups.GUI.MainPanelElements.MainComboBoxes.mainPanelComboBoxes(); + } +} diff --git a/src/Projects/CourtScraper/StartGUI.java b/src/Projects/CourtScraper/StartGUI.java new file mode 100644 index 0000000..f661506 --- /dev/null +++ b/src/Projects/CourtScraper/StartGUI.java @@ -0,0 +1,21 @@ +package CourtScraper; + +import CourtScraper.Setups.GUI.Interface; +import org.openqa.selenium.WebDriver; + +public class StartGUI { + + public static WebDriver driver; + + public static void main( String[] args ) throws InterruptedException { + try { + //Initializes interface + Interface.mainGUI(); + + //Flow actually starts in Buttons.java inside of GUI. Inside the startButton function + } catch (Exception e) { + e.printStackTrace(); + } + } + +}