0
サイト全体のHTMLタグをダウンロードし、HtmlAgility.HtmlNodeCollection C#に割り当てました。今、私はHTMLのimage srcだけをフィルタリングしています。HtmlAgility.HtmlNodeCollectionの画像の高さと幅c#
これは私のコードです:だから
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);
、HtmlNodeCollectionクラスを使用して、イメージの高さと幅や素子高さと幅を取得する方法はありますか?
おかげで "SRC" を交換してください。私はSystem.windows.forms.HtmlNodeCollectionではなくHtmlAgility.HtmlNodeCollectionを使用しています –
誰かが既にそれに答えています:http://stackoverflow.com/questions/13782352/i-want-to-retrieve-the-width-and-height-of- html-element-with-htmlagilitypack –
ありがとうスタンレー。その答えでは、html要素にwidth属性とheight属性がない場合は何も返しません。 –