Compare commits
8 Commits
main
..
228e6b896e
| Author | SHA1 | Date | |
|---|---|---|---|
| 228e6b896e | |||
| 5329b69c2e | |||
| 3aa8b85c59 | |||
| 869b0b466e | |||
| 430c5fd2b8 | |||
| 28bad6c3c1 | |||
| 7684e8869b | |||
| 99eb077d14 |
@@ -1,7 +1,6 @@
|
|||||||
[Pp]assword.txt
|
[Pp]assword.txt
|
||||||
CVV.txt
|
CVV.txt
|
||||||
CardDetails.txt
|
CardDetails.txt
|
||||||
run.bat
|
|
||||||
|
|
||||||
# ---> VisualStudioCode
|
# ---> VisualStudioCode
|
||||||
.vscode/*
|
.vscode/*
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ public static class GoogleMessages
|
|||||||
string messageText = await messageElement.InnerTextAsync();
|
string messageText = await messageElement.InnerTextAsync();
|
||||||
|
|
||||||
await originalPage.BringToFrontAsync();
|
await originalPage.BringToFrontAsync();
|
||||||
await msgPage.CloseAsync();
|
|
||||||
return messageText;
|
return messageText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,6 @@ try
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Error during login: {ex.Message}\nAssuming already logged in, proceeding with booking...");
|
Console.WriteLine($"Error during login: {ex.Message}\nAssuming already logged in, proceeding with booking...");
|
||||||
await page.CloseAsync();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +98,6 @@ catch (PlaywrightException)
|
|||||||
{
|
{
|
||||||
Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Could not find the specified end time slot: {endTime}");
|
Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Could not find the specified end time slot: {endTime}");
|
||||||
await page.ScreenshotAsync(new PageScreenshotOptions { Path = "ErrorScreenshot.png" });
|
await page.ScreenshotAsync(new PageScreenshotOptions { Path = "ErrorScreenshot.png" });
|
||||||
await page.CloseAsync();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,16 +118,10 @@ var bmlOtp = await GoogleMessages.GetBMLOTP(context, page);
|
|||||||
if (bmlOtp is not null)
|
if (bmlOtp is not null)
|
||||||
Console.WriteLine($"Extracted BML OTP: {bmlOtp}");
|
Console.WriteLine($"Extracted BML OTP: {bmlOtp}");
|
||||||
else
|
else
|
||||||
{
|
|
||||||
await page.CloseAsync();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
await page.Locator("input[name='otpValue']").FillAsync(bmlOtp);
|
await page.Locator("input[name='otpValue']").FillAsync(bmlOtp);
|
||||||
await page.GetByRole(AriaRole.Button, new() { Name = "CONFIRM" }).ClickAsync();
|
await page.GetByRole(AriaRole.Button, new() { Name = "CONFIRM" }).ClickAsync();
|
||||||
await Task.Delay(15000);
|
await Task.Delay(15000);
|
||||||
|
|
||||||
var hdcMessage = await GoogleMessages.GetMessageFromHDC(context, page);
|
var hdcMessage = await GoogleMessages.GetMessageFromHDC(context, page);
|
||||||
Console.WriteLine($"Message from HDC: {hdcMessage}");
|
Console.WriteLine($"Message from HDC: {hdcMessage}");
|
||||||
|
|
||||||
await page.CloseAsync();
|
|
||||||
@@ -9,5 +9,3 @@ In the future perhaps it would be much better if I can deploy as a webapp that c
|
|||||||
Where `22:00` is the end time of the prefered time. `22:00` is the slot from `21:00 - 22:00`.
|
Where `22:00` is the end time of the prefered time. `22:00` is the slot from `21:00 - 22:00`.
|
||||||
|
|
||||||
Preferably the application will be run close to 8AM around 7:45AM so that there's need to perpetually keep refreshing the site for a long time.
|
Preferably the application will be run close to 8AM around 7:45AM so that there's need to perpetually keep refreshing the site for a long time.
|
||||||
|
|
||||||
**``OWO``**
|
|
||||||
Reference in New Issue
Block a user