Solution 1 :

Use load for only files. In this example, you ar loading an url,
So you should use web.LoahHtml
İf you do this. It will work

Solution 2 :

HtmlAgilityPack does not handle javascript, so you can use selenium to store the html source code via webDriver.

IWebDriver webDriver = new ChromeDriver();

webDriver.Url = "";
var pageSource = webDriver.PageSource;

var doc = new HtmlDocument();

 var xPath = @"//*[@class='team team-won']";

 var node = doc.DocumentNode.SelectSingleNode(xPath);


Make sure that you have already downloaded and stored in same directory the webDriver.(i used chrome driver downloaded from here

Problem :

I’m trying to get data from this site:, and it doesnt work. SelectNodes always returns null, I’ve tried using xpath, full xpath and so on and different things other than HtmlAgilityPack. Maybe its not the HtmlAgilityPack maybe the problem is in the tags.
Please take a look at the code and view also the tags to see if if i copied it right:

    HtmlWeb web = new HtmlWeb();
    var doc = web.Load("");
    var teams = doc.DocumentNode.SelectNodes("//*[@class='team team-won']");

Please Help, Thanks!


Comment posted by SimplyBoost

thank you it worked ive tried to do it with htmlagilitypack and other stuff for days! thanks!!


Leave a Reply

Your email address will not be published. Required fields are marked *