@him tim, Welcome to Microsoft Q&A, you could try to get the specific fileid from the url.
First, please install nuget-package HtmlAgilityPack.
Then, you could try to use the following code to get the FileID:
static void Main(string[] args)
{
string url = "https://www.uaeiec.gov.ae/en-us/un-page?p=1";
HtmlWeb web = new HtmlWeb();
HtmlDocument document = web.Load(url);
var anchor = document.DocumentNode.SelectNodes("//h5");
foreach (var item in anchor)
{
foreach (var att in item.GetAttributes())
{
if (att.Name == "title"&&att.Value == "UNSC Resolution 1373")
{
string html = item.InnerHtml.Trim();
var doc = new HtmlDocument();
doc.LoadHtml(html);
string value = doc.DocumentNode.SelectSingleNode("//a").Attributes["href"].Value;
int index = value.IndexOf("FileID=");
string fileid=value.Substring(index+7);
Console.WriteLine( fileid);
}
}
}
}
Result:
The first result is I get from console and the second is I get from copy that link.
Hope my solution could be helpful for you.
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.