2014-11-04 54 views
0

我有div沒有idclass,我需要選擇。我想通過價值來做到這一點(因爲我能想到的唯一途徑):我可以通過HtmlAgilityPack中的值選擇div嗎?

<div style=""> foo: baa </div> 

我該怎麼做?

想象XPath查詢://div[contains(@innerText,'foo:')]

+0

有很多類似的問題 - 你可能尋找「如何當前節點傳遞給XPath函數」(「」 /「self」/「current()」) - http://stackoverflow.com/questions/1022345/current-node-vs-context-node-in-xslt-xpath。 – 2014-11-04 23:26:50

回答

1

您正在尋找這樣的:

//div[contains(.,'foo:')] 
相關問題