private static string GetWinRate(string htmlDotabuff) { string winRate = "N/A"; string pattern = "<dd>(.*?)</dd>"; var result = CustomWebClient.GetContents(htmlDotabuff, pattern); for (var i = 0; i < result.Count; i++) { if (result[i].Contains("%")) { winRate = result[i].Replace("<dd>", "").Replace("</dd>", ""); break; } } return winRate; }
private static string GetGrate(string htmlDotabuff) { string grate = "N/A"; string pattern = "<div class=\"grade\"(.*?)>(.*?)</div>"; var result = CustomWebClient.GetContents(htmlDotabuff, pattern); for (var i = 0; i < result.Count; i++) { if (result[i].StartsWith("<div class=\"grade\"") && result[i].EndsWith("</div>")) { char symbol = result[i][result[i].Length - 7]; grate = (symbol == '-' || symbol == '+') ? result[i].Substring(result[i].Length-8, 2) : symbol.ToString(); break; } } return grate; }
private static string GetRole(string htmlDotabuff) { string role = "N/A"; string pattern = "<div class=\"sector role index-0\"(.*?)>(.*?)</div>"; var result = CustomWebClient.GetContents(htmlDotabuff, pattern); for (var i = 0; i < result.Count; i++) { pattern = "</i>(.*?)</div>"; var result2 = CustomWebClient.GetContents(result[i], pattern); for (var i2 = 0; i2 < result2.Count; i2++) { if (result2[i2].StartsWith("</i> ") && result2[i2].EndsWith("</div>")) { role = result2[i2].Replace("</i> ", "").Replace("</div>", ""); return role; } } } return role; }