follow-sibling :: text()仅在包含needle时

TMi*_*hel 4 xpath

在PHP-Xpath中,我在<br />标签之间获取文字,如:

//*/br/following-sibling::text()
Run Code Online (Sandbox Code Playgroud)

如果包含'needle',我怎么能得到这个文本?

br[contains(.,'needle')]- 或 - 的东西following-sibling::*contains(.,'needle')/text()

感谢任何帮助

Dim*_*hev 9

用途:

following-sibling::text()[contains(., 'needle')]
Run Code Online (Sandbox Code Playgroud)