public static async Task<List<MalMessageModel>> GetComToComMessages(string path) { try { var client = await MalHttpContextProvider.GetHttpContextAsync(); var response = await client.GetAsync($"/comtocom.php?{path}"); var doc = new HtmlDocument(); doc.LoadHtml(await response.Content.ReadAsStringAsync()); var output = new List<MalMessageModel>(); foreach (var commentBox in doc.FirstOfDescendantsWithId("div","content").ChildNodes.Where(node => node.Name == "div").Skip(1)) { try { var current = new MalMessageModel(); current.Content = WebUtility.HtmlDecode(commentBox.FirstOfDescendantsWithClass("div", "spaceit").InnerText).Trim(); current.Date = commentBox.Descendants("small").First().InnerText.Trim(new[] { '|', ' ' }); current.Sender = WebUtility.HtmlDecode(commentBox.Descendants("a").Skip(1).First().InnerText.Trim()); output.Add(current); } catch (Exception) { //html } } output.Reverse(); return output; } catch (WebException) { MalHttpContextProvider.ErrorMessage("Messages"); return new List<MalMessageModel>(); } }