U
U
Uncle Bogdan2021-08-03 18:45:25
Parsing
Uncle Bogdan, 2021-08-03 18:45:25

Why is html node collection null even though the site is fine?

Like on the site everything is fine, but through the code everything is bad. Either

website :


private HtmlNode CheckXpath(string xpath)
        {
            if(!string.IsNullOrEmpty(xpath))
            {
                if (html.DocumentNode.SelectNodes(xpath) != null)
                {
                    return html.DocumentNode.SelectNodes(xpath)[0];
                }
            }

            return null;
        }


xpath = //*[@id='gr_case_partps']/table/tbody/tr/td[2]/div/ul/li/span/a

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question