Is it possible to retrieve the height of a class
in C#
?
I am currently utilizing HTMLAgilityPack
to access the nodes. Here is my current code.
private async void GetCldInfos()
{
string sURL = @"https://m.investing.com/economic-calendar/";
using (HttpClient clientduplicate = new HttpClient())
{
clientduplicate.DefaultRequestHeaders.Add("User-Agent",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident / 6.0)");
using (HttpResponseMessage responseduplicate = await clientduplicate.GetAsync(sURL))
using (HttpContent contentduplicate = responseduplicate.Content)
{
try
{
string resultduplicate = await contentduplicate.ReadAsStringAsync();
var websiteduplicate = new HtmlDocument();
websiteduplicate.LoadHtml(resultduplicate);
var News = websiteduplicate.DocumentNode.Descendants("div").Where(o => o.GetAttributeValue("class", "") == "js-economic-calendar").Single();
//get height here
}
catch (Exception ex1)
{
throw ex1.InnerException;
}
}
}
}
Edit: an image can be found here: https://i.sstatic.net/DN8AL.png In the image, I am struggling to determine its height. Is there a way to obtain this height programmatically? My intention is to incorporate it into a scroll viewer. I have disabled the browser's scroll bars so that I can utilize my own. Therefore, I need to adjust the scroll viewer's height to correspond with the form...