I am using HtmlAgilityPack to grab a table from a web page.
HtmlWeb web = new HtmlWeb();
HtmlDocument doc = web.Load("http://test.com");
I am aware that HtmlWeb has a UserAgent property, however I have no idea how I am supposed to attach a user agent to the header of the httprequest.
HtmlWeb web = new HtmlWeb().UserAgent("asdf");
returns the error
Error 1 Non-invocable member 'HtmlAgilityPack.HtmlWeb.UserAgent' cannot be used like a method.
http://htmlagilitypack.codeplex.com/discussions HtmlAgilityPack support discussions appear as simply questions, but nobody on the other end to respond.
http://htmlagilitypack.codeplex.com/documentation There is NO documentation here yet.
http://htmlagilitypack.codeplex.com/downloads/get/437942 Tried downloading the documentation, to find that the chm file seems broken… I’m getting a Navigation to the webpage was cancelled error when I try to open anything within the chm documentation.
Just set the
UserAgentproperty of theHtmlWebobject after instantiating it.