我可以使用HTMLAgility
在节点选择中添加OR子句吗?(HtmlAgilityPack.HtmlNodeCollection)doc.DocumentNode.SelectNodes("//td[@class=\"roomPrice figure\"]");
我需要的是有时候它应该像SelectNodes("//td[@class=\"roomPrice figure\"]");
,有时候它就像SelectNodes("//td[@class=\"roomPrice figure bb\"]");
我需要同时获得两个课程roomPrice figure
或roomPrice figure bb
我怎样才能做到这一点。
感谢您的帮助
答案 0 :(得分:2)
Xpath确实有一个OR运算符。试试这个选择查询 -
"//td[@class=\"roomPrice figure\" or @class=\"roomPrice figure bb\"]"