Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Count size of loaded content, or preferably transferred size

$
0
0
Of course I came up with one possible solution just after I posted this. Using System.Net namespace, I can download the web page as a string before passing it on to HTML Agility Pack:
var wc = new WebClient();
var htmlText = wc.DownloadString(uriBillboardSearch);
var htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(htmlText);
htmlText.Length would hold the size of downloaded content, right?

In other words, instead of HtmlWeb.Load() use WebClient.DownloadString combined with HtmlDocument.LoadHtml().
Is there any better way or a way? Any other thoughts?

Thanks!

//M

Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>