我可以使用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\"]"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top