Question

i have problem and if someone can help me please. i want to load html.

var webGet = new HtmlWeb();
var doc = webGet.Load(@"https://example.com/search_engine/jobs.cgi?owner=5027409&ownertype=fair&posting_code=612");

i using htmlagilitypack but it can't load html. I download html in my local PC and it load from there.

Many Thanks.

Popular Answer

You're overdoing it a little. All you need is:

//using for IDisposable.Dispose()
using (WebClient client = new WebClient())
{
    string html = client.DownloadString("http://stackoverflow.com");
    //Do something with html then
}


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why