public static string FirstWord = "uploads";
public static string linkHtml = @"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">
<meta http-equiv=""content-type"" content=""text/html; charset=utf-8"">
<meta name=""generator"" content=""PSPad editor, www.pspad.com"">
<div class=""entry-content"">
<p><img src=""http://example.com/wp-content/uploads/2019/05/00001.jpg"" alt=""00001.jpg"" width=""640"" height=""1138""><br>
<span id=""more-274501""></span><br>
Information: MP4, UltraHD/2K, 1080×1920<br>
<p><a href=""https://example.com/file/wanted.mp4"" target=""_blank"" rel=""noopener noreferrer"">Wanted.mp4 from example (621.39 MB)</a><div class=""example-preview wrap"" style=""max-width: 640px; padding: 2px 5px;""><div style=""padding-bottom: 56.25%;"" class=""sub-wrap""><div class=""example-loading-spinner""></div><div class=""poster"" style=""background: rgb(0, 0, 0) url("https://static-cache.example.com/thumbnail/0d3ff44ea945e/main/0.jpeg") no-repeat scroll 50% 50% / contain;""></div><a href=""#"" class=""play-btn""><i style=""background-image: url("https://example.com/static/media/play-button.svg");""></i></a><a class=""download-btn"" style=""background: rgba(0, 0, 0, 0) url("https://example.com/static/media/cloud.svg") no-repeat scroll 0% 0% / contain;"" target=""_blank"" href=""https://example.com/file/0d3ff44ea945e?utm_source=partner&utm_medium=referral&forceDownload=1&utm_campaign=preview_download""></a></div></div><script src=""https://example.com/js/preview.js"" data-padding=""2px 5px"" data-width=""640px"" data-height=""56.25%"" data-url=""https://example.com/file/wanted.mp4""></script></p>
<p><a href=""https://example.com/code/Not Wanted.html
"" target=""_blank"" rel=""noopener noreferrer"">Not Wanted</a></p>
public static void Main()
private static void FetchPage(string linkHtml)
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.LoadHtml(linkHtml);
var DivHTML = htmlDoc.DocumentNode.DescendantsAndSelf("//div[starts-with(@id,'entry-content')]");
foreach (var divNodes in DivHTML)
var ImageNodes = divNodes.Descendants("img");
foreach (var ImgNode in ImageNodes)
HtmlAttribute src = ImgNode.Attributes["src"];
string imageSRC = src.Value;
if (imageSRC.Contains(FirstWord) && imageSRC.EndsWith("jpg"))
Console.WriteLine("img.src: " + imageSRC);
var linkNode = divNodes.SelectSingleNode("//a");
string DLlink = linkNode.Attributes["href"].Value;
if (DLlink.Contains("example"))
Console.WriteLine("DLlink.href: " + DLlink);