-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScrapeSelector.cs
79 lines (74 loc) · 2.35 KB
/
ScrapeSelector.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace Scrappy2._0
{
class ScrapeSelector
{
public int SelectedSite()
{
try
{
Console.WriteLine("Choose from the following options: \n 1. Bet365 \n 2. SMarkets \n 3. Matchbook\n 4. Quit");
int selection = Convert.ToInt32(Console.ReadLine());
return selection;
}
catch (Exception e)
{
Console.WriteLine("Error: {0} ", e.Message);
}
return 0;
}
public static void HandleSelection(int _selection)
{
if (_selection == 0)
{
ScrapeSelector obj = new ScrapeSelector();
obj.SelectedSite();
}
if (_selection == 1)
{
Program.scraping365 = true;
RootClass.GetRootPage("https://www.bet365.com/#/AS/B1/");
if (Bet365.leagueDivisionDict.Count() == 0)
{
Bet365.InitiateList();
MatchPath.CreateList();
}
Bet365.LeagueSelection();
Program.settingUp = false;
}
if (_selection == 2)
{
//SmarketsCode Initialize
Program.scrapingSmarkets = true;
RootClass.GetRootPage("https://smarkets.com/sport/football");
RootClass.SetImplicitWait(7);
Smarkets.InitiateList();
Smarkets.ScrapeSelection();
}
if (_selection == 3)
{
//MatchbookCode Initialize
Program.scrapingMatchbook = true;
RootClass.GetRootPage("https://www.matchbook.com/events/soccer");
RootClass.SetImplicitWait(7);
Matchbook.InitiateList();
Matchbook.ScrapeSelection();
}
if (_selection == 4)
{
RootClass.Quit();
}
else
{
Debug.Write("Error in HandleSelection()");
}
}
}
}