diff --git a/.gitignore b/.gitignore index 81a0e43..7c3f88f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -schedule.csv +*tar.gz +*csv # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/mdh.py b/mdh.py index 2acd7d7..95c7183 100644 --- a/mdh.py +++ b/mdh.py @@ -37,12 +37,12 @@ def start_shift(playwright: Playwright, end_hour: str, end_minute: str) -> None: hrButton.click() - box = page.get_by_text(str(end_hour), exact=True).bounding_box() + box = page.get_by_text(str(end_hour)).last().bounding_box() page.mouse.click(box["x"] + box["width"] / 2, box["y"] + box["height"] / 2) minButton.click() - box = page.get_by_text(str(end_minute), exact=True).bounding_box() + box = page.get_by_text(str(end_minute)).last().bounding_box() page.mouse.click(box["x"] + box["width"] / 2, box["y"] + box["height"] / 2) page.get_by_role("button", name="OK").click() @@ -61,9 +61,9 @@ def end_shift(playwright: Playwright) -> None: page = context.new_page() page.goto("https://beta.mydigitalhand.org/") page.locator("input[name=\"email\"]").click() - page.locator("input[name=\"email\"]").fill("***REMOVED***") + page.locator("input[name=\"email\"]").fill(EMAIL) page.locator("input[name=\"password\"]").click() - page.locator("input[name=\"password\"]").fill("***REMOVED***") + page.locator("input[name=\"password\"]").fill(PASSWORD) page.get_by_role("button", name="Sign in").click() page.get_by_role("link", name="University of North Carolina").click() page.get_by_role("button", name="Waitlist").click() @@ -79,7 +79,7 @@ def end_shift(playwright: Playwright) -> None: if __name__ == "__main__": times = [] - with open("schedule.csv") as f: + with open("/rushil/auto-mdh/schedule.csv") as f: for line in f: if line.startswith("Day"): continue diff --git a/schedule.csv b/schedule.csv index b66a27c..9ac05c1 100644 --- a/schedule.csv +++ b/schedule.csv @@ -2,4 +2,4 @@ Day,Start Time,End Time 1,17:00,19:00 2,11:00,14:00 3,17:00,19:00 -4,14:00,17:00 \ No newline at end of file +4,14:00,17:00