Reputation: 184
I'm using the HTMLAgilityPack and mostly works fine however on this particular website, the XPath returns a null when it should return a value. I tried various XPath and none seem to work. If someone can pinpoint the problem. I also want to point out that the website table is dynamic if it makes any difference.
Also I tested the XPath in XPath Helper Chrome Add-on and it shows the correct value but returns null in HTMLAgilityPack.
string Url = "http://weather.deltixlab.com";
HtmlWeb web = new HtmlWeb();
HtmlDocument doc = web.Load(Url);
string day1 = doc.DocumentNode.SelectSingleNode("//*[@id=\"free-data-table\"]/tbody/tr[1]/td[1]").InnerText;
Below is a snippet of the HTML as well as the site link: http://weather.deltixlab.com
Upvotes: 0
Views: 301
Reputation: 389
I think your problem in web page working principle. Page load content into home section after loading via web socket.
May be it will be more easily to use webbrowser control to load page completly and parse data via DOM?
If such a decision is acceptable i can write litle code for your.
Upvotes: 1