public async Task getHeaderArticleData() { if (HeaderPosts.Count != 0) { return; } string htmlPage; try { using (var client = new HttpClient()) { htmlPage = await client.GetStringAsync("http://id.wikihow.com/Halaman-Utama").ConfigureAwait(false); } htmlDocument.LoadHtml(htmlPage); var innerText = htmlDocument.DocumentNode .Descendants("div") .Where(o => o.GetAttributeValue("class", "") == "hp_top").ToList(); foreach (var div in innerText) { Post newPosts = new Post(); string imageUrl = ""; string title = ""; string url = ""; string htmlDiv = "<html>" + div.OuterHtml + "</html>"; imageUrl = Regex.Match(htmlDiv, "<img.+?src=[\"'](.+?)[\"'].*?>", RegexOptions.IgnoreCase).Groups[1].Value; title = Regex.Match(htmlDiv, "<div.+?title=[\"'](.+?)[\"'].*?>", RegexOptions.IgnoreCase).Groups[1].Value; url = Regex.Match(htmlDiv, "<a.+?href=[\"'](.+?)[\"'].*?>", RegexOptions.IgnoreCase).Groups[1].Value; title = WebUtility.HtmlDecode(title); //HtmlDecode //"http://id.wikihow.com" + newPosts.Title = "CARA " + title; newPosts.ImageUrl = imageUrl; newPosts.PostUrl = "https://id.wikihow.com" + url; HeaderPosts.Add(newPosts); } } catch (Exception) { } }