[英]Image height and width in HtmlAgility.HtmlNodeCollection c#
I am downloading the whole site html tags and assigned it into HtmlAgility.HtmlNodeCollection c#. 我正在下载整个站点的html标记,并将其分配到HtmlAgility.HtmlNodeCollection c#中。 Now I am filtering only image src in Html. 现在我只过滤HTML中的image src。
This is my code: 这是我的代码:
string responseFromServer = string.Empty;
Uri url = new Uri(requestedURL);
using (WebClient wc = new WebClient())
{
responseFromServer = wc.DownloadString(url);
}
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(responseFromServer);
So, is there any way to get image height and width or element height and width using HtmlNodeCollection class? 因此,有没有办法使用HtmlNodeCollection类获取图像的高度和宽度或元素的高度和宽度?
Read this : 读这个 :
https://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.images(v=vs.110).aspx https://msdn.microsoft.com/zh-CN/library/system.windows.forms.htmldocument.images(v=vs.110).aspx
Replace "src" with "width" and "height" 将“ src”替换为“ width”和“ height”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.