Add Initial Logic for EuroMillions Processing.
This commit is contained in:
43
lottery-co-uk-scraper/EuroMillions/Euros.cs
Normal file
43
lottery-co-uk-scraper/EuroMillions/Euros.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using HtmlAgilityPack;
|
||||
using lottery_co_uk_scraper.core.Models;
|
||||
using lottery_co_uk_scraper.data;
|
||||
|
||||
namespace lottery_co_uk_scraper.EuroMillions
|
||||
{
|
||||
internal class Euros
|
||||
{
|
||||
public static async Task GetEuroMillionsData(string url, HttpClient client)
|
||||
{
|
||||
try
|
||||
{
|
||||
string html = await client.GetStringAsync(url);
|
||||
var eurosResult = new EurosResult();
|
||||
var doc = new HtmlDocument();
|
||||
doc.LoadHtml(html);
|
||||
|
||||
DrawBalls.ProcessBallSetUsed(doc, eurosResult);
|
||||
DrawDate.ProcessDrawDateFromMeta(doc, eurosResult); // Not working.
|
||||
DrawNumber.ProcessDrawNumberFromMeta(doc, eurosResult);
|
||||
DrawCode.ProcessMillionaireMaker(doc, eurosResult); // Not working.
|
||||
DrawStatus.ProcessRollover(doc, eurosResult);
|
||||
DrawBalls.ProcessMainBalls(doc, eurosResult);
|
||||
DrawBalls.ProcessLuckyStars(doc, eurosResult);
|
||||
DrawMachine.ProcessMachineUsed(doc, eurosResult);
|
||||
DrawWinnerInformation.ProcessWinnersTable(doc, eurosResult);
|
||||
|
||||
|
||||
CommitToDatabase.SaveModelToDatabase(eurosResult);
|
||||
}
|
||||
catch (HttpRequestException ex)
|
||||
{
|
||||
// ToDo: Logger HTTP request error: {ex.Message}
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// ToDo: Logger - An error occurred: {ex.Message}
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user