static void Main() { ChromeOptions options = new ChromeOptions(); options.AddArgument("--mute-audio"); options.AddArgument("--disable-images"); //options.AddArgument("--headless"); //options.AddArgument("-headless"); ChromeDriverService service = ChromeDriverService.CreateDefaultService(); service.HideCommandPromptWindow = true; driver = new ChromeDriver(service, options); api = new FlashScoreApi { driver = driver }; for (int i = 0; i < 10; i++) { Console.WriteLine("\n\n################# Проверка номер {0} #################\n\n", i + 1); try { StartTest().Wait(); Thread.Sleep(1000 * 5); //Console.ReadLine(); //Console.ReadLine(); // driver.Quit(); } catch (Exception e) { Console.WriteLine(e.Message); //driver.Quit(); } } Console.ReadLine(); }
async static void Test() { FlashScoreApi FlashScore = new FlashScoreApi(); var matches = await FlashScore.GetAllMatchesAsync(DayInfo.Today); var info = await matches.GetInfoAsync(true, true, true, true); foreach (var match in info) { string test = ""; test += "name: " + match.Match.Name + " | " + "time: " + match.Match.DateStart + " | " + "liga: " + match.Match.Liga + " | " + "link: " + match.Link + " | "; //foreach (var matchTotal in match.Coefficient.BM) //{ // test += "key:" + matchTotal.Total + "\n"; // test += "bk:" + matchTotal.BkName + "\n"; // test += "more:" + matchTotal.More + "\n"; // test += "less:" + matchTotal.More + "\n"; //} Console.WriteLine(test + "\n"); } }
public async Task Get_All_Math() { FlashScoreApi flashApi = new FlashScoreApi(); var allMatch = await flashApi.GetAllMatchesAsync(); Debug.WriteLine("get all match"); }
public async Task Get_All_Match_Info() { FlashScoreApi flashApi = new FlashScoreApi(); var allMatch = await flashApi.GetAllMatchesAsync(); Debug.WriteLine("get all match"); await allMatch.GetInfoAsync(true, true, true, true); Debug.WriteLine("get all match info"); }