2
所有文字我的html:獲得從子節點與最小長度
<div>
<div>text test <span>text aa bb</span></div>
<p>text esa sssddf safdf <a href="">adsfdsf</a> sdf sdf</p>
<p>text <a href="">adsfdsf</a> sdf
<b>text esa sssddf safdf <a href="">adsfdsf</a> sdf sdf</b>
</p>
</div>
沒有我需要的XPath擺脫的div和p元素的所有文本具有至少20個字符長度。這可能嗎?
現在我想//p/text()[string-length() > 20]
但是,這並不正常工作
預期結果:
text test text aa bb
text esa sssddf safdf adsfdsf sdf sdf
text adsfdsf sdf text esa sssddf safdf adsfdsf sdf sdf
[Xpath深度最大的節點的字符串內容長於給定長度]的可能重複(http://stackoverflow.com/questions/4493323/xpath-deepest-node-whose-string-content-is-longer-than -a-給定長度的) –