public Dictionary <string, List <Models.ScoreMatches> > GetScores(MyScoreRequest requestData) { WebClient wc = new WebClient(); wc.Headers.Add(HttpRequestHeader.Cookie, requestData.Cookie); wc.Headers.Add("X-Fsign", requestData.X_Fsign); wc.Headers.Add("Accept-Language", "ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"); wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); wc.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); string html = wc.DownloadString("https://d.myscore.com.ua/x/feed/d_hh_" + MyScoreServices.GetIdMatch(requestData.href) + "_ru_1"); IHtmlDocument angle = new HtmlParser().Parse(html); List <Models.ScoreMatches> liHomeScores = new List <Models.ScoreMatches>(); var scores = angle.getScoresTemplate(".h2h_home"); liHomeScores = GetListScoreFromTemplate(scores); List <Models.ScoreMatches> liGuestScores = new List <Models.ScoreMatches>(); var scoresGuest = angle.getScoresTemplate(" .h2h_away"); liGuestScores = GetListScoreFromTemplate(scoresGuest); List <Models.ScoreMatches> ListMutualSccores = new List <Models.ScoreMatches>(); var mutualScores = angle.getScoresTemplate(" .h2h_mutual"); ListMutualSccores = GetListScoreFromTemplate(mutualScores); Dictionary <string, List <Models.ScoreMatches> > resultDict = new Dictionary <string, List <Models.ScoreMatches> >(); resultDict.Add("Home", liHomeScores); resultDict.Add("Guest", liGuestScores); resultDict.Add("Mutual ", ListMutualSccores); // var trs = tables[0].Children[0].Children[0].Children[0].TextContent; // var trs2 = tables[0].Children[0].Children[0].Children[2].TextContent; return(resultDict); }
public static void GetHrefFromServices() { Assert.Equal("QNFzlSzS", MyScoreServices.GetIdMatch("https://www.myscore.com.ua/match/QNFzlSzS/#match-summary")); }