How to Put OR condition in Xpath using Html AGility Pack

c# html-agility-pack

Question

My concern is with HTML Agility Pack.

The node collection whose isPublished attribute for the Div is either "False" or "false" is what I'm after.

I don't know how to add the OR condition to XPATH. My broken code is shown below. It gives null back.

 HtmlNodeCollection numbers = 
 htmlDoc.DocumentNode.SelectNodes("//div[@ispublished='false|False']");

Thanks

1
4
6/18/2013 4:20:31 PM

Accepted Answer

Try

htmlDoc.DocumentNode.SelectNodes("//div[@ispublished='false' or @ispublished='False']");
12
6/18/2013 4:22:09 PM

Popular Answer

Have you attempted

htmlDoc.DocumentNode.SelectNodes("//div[@ispublished='false' or @ispublished='False']");

On or xpath, more



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow