1

HTMLAgility を使用してノード選択に OR 句を入れることはできますか

(HtmlAgilityPack.HtmlNodeCollection)doc.DocumentNode.SelectNodes("//td[@class=\"roomPrice figure\"]");

私が必要としているのは、そうあるべき時とそうあるSelectNodes("//td[@class=\"roomPrice figure\"]"); 時があることですSelectNodes("//td[@class=\"roomPrice figure bb\"]");

いずれかのクラスを取得する必要がありますroomPrice figureORroomPrice figure bb

どうすればこれを達成できますか。

ご協力いただきありがとうございます

4

1 に答える 1

2

Xpath には OR 演算子があります。選択クエリでこれを試してください-

"//td[@class=\"roomPrice figure\" or @class=\"roomPrice figure bb\"]"
于 2010-06-27T23:32:16.080 に答える