Question

Can I put OR clause in node selection using HTMLAgility

(HtmlAgilityPack.HtmlNodeCollection)doc.DocumentNode.SelectNodes("//td[@class=\"roomPrice figure\"]");

What I need is some times it should be like SelectNodes("//td[@class=\"roomPrice figure\"]"); and some times it is like SelectNodes("//td[@class=\"roomPrice figure bb\"]");

I need to get both either class will roomPrice figure OR roomPrice figure bb

How can I accomplish this.

Thanks for your help

Was it helpful?

Solution

Xpath does have an OR operator. Try this for your selection query -

"//td[@class=\"roomPrice figure\" or @class=\"roomPrice figure bb\"]"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top