mirror of
https://github.com/Rushilwiz/auto-mdh.git
synced 2025-04-09 23:00:18 -04:00
fix: removed last error
This commit is contained in:
parent
54927e072d
commit
287240b358
10
mdh.py
10
mdh.py
|
@ -8,7 +8,7 @@ def start_shift(playwright: Playwright, end_hour: str, end_minute: str) -> None:
|
|||
if int(end_hour) > 12:
|
||||
end_hour = str(int(end_hour) - 12)
|
||||
|
||||
browser = playwright.chromium.launch(headless=True)
|
||||
browser = playwright.chromium.launch(headless=False)
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto("https://beta.mydigitalhand.org/")
|
||||
|
@ -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)).last().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)).last().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()
|
||||
|
@ -56,7 +56,7 @@ def start_shift(playwright: Playwright, end_hour: str, end_minute: str) -> None:
|
|||
browser.close()
|
||||
|
||||
def end_shift(playwright: Playwright) -> None:
|
||||
browser = playwright.chromium.launch(headless=True)
|
||||
browser = playwright.chromium.launch(headless=False)
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto("https://beta.mydigitalhand.org/")
|
||||
|
@ -79,7 +79,7 @@ def end_shift(playwright: Playwright) -> None:
|
|||
if __name__ == "__main__":
|
||||
times = []
|
||||
|
||||
with open("/rushil/auto-mdh/schedule.csv") as f:
|
||||
with open("schedule.csv") as f:
|
||||
for line in f:
|
||||
if line.startswith("Day"):
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue
Block a user