From 46e793135f83db5e8f6eb8780307b458cc52f259 Mon Sep 17 00:00:00 2001 From: Enxyphered Date: Tue, 14 Apr 2026 18:28:29 +0500 Subject: [PATCH] Updated error handling and logging. --- Program.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index cb78bdf..5f78497 100644 --- a/Program.cs +++ b/Program.cs @@ -90,12 +90,14 @@ while (!debug && (currentDateTime < lowerBound || currentDateTime >= upperBound) await page.Locator("div.flex.items-center.justify-end > div > div:nth-child(2) > svg").ClickAsync(); try { - await page.Locator("div.grid.bg-gray-100.rounded-lg.anim").Filter(new () { HasText = endTime }).ClickAsync( new() { Timeout = 1000 }); + Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Clicking next for tomorrow's time slots..."); + await page.Locator("div.grid.bg-gray-100.rounded-lg.anim").Filter(new () { HasText = endTime }).ClickAsync( new() { Timeout = 2000 }); + Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Timeslot found and clicked."); } catch (PlaywrightException) { + Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Could not find the specified end time slot: {endTime}"); await page.ScreenshotAsync(new PageScreenshotOptions { Path = "ErrorScreenshot.png" }); - Console.WriteLine($"Could not find the specified end time slot: {endTime}"); return; }