views:

34

answers:

1

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

+1  A: 

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

"//td[@class=\"roomPrice figure\" or @class=\"roomPrice figure bb\"]"
Rohit Agarwal