我可以使用HTMLAgility在节点选择中放入OR子句吗
(HtmlAgilityPack.HtmlNodeCollection)doc.DocumentNode.SelectNodes("//td[@class=\"roomPrice figure\"]");
SelectNodes("//td[@class=\"roomPrice figure\"]"); 有时候就像 SelectNodes("//td[@class=\"roomPrice figure bb\"]");
SelectNodes("//td[@class=\"roomPrice figure\"]");
SelectNodes("//td[@class=\"roomPrice figure bb\"]");
两个班我都要 roomPrice figure 或者 roomPrice figure bb
roomPrice figure
roomPrice figure bb
我怎样才能做到这一点。
Xpath没有OR运算符。为您的选择查询尝试此操作-
"//td[@class=\"roomPrice figure\" or @class=\"roomPrice figure bb\"]"