在节点选择标准中添加或子句 - HTMLAGIABY
-
30-09-2019 - |
题
我可以使用htmlagition放入节点选择中或子句
(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
我该怎么做。
谢谢你的帮助
解决方案
XPath确实有一个或操作员。尝试此信息查询 -
"//td[@class=\"roomPrice figure\" or @class=\"roomPrice figure bb\"]"
不隶属于 StackOverflow