且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在两个节点之间选择文本

更新时间:2023-02-01 22:32:44

您可以使用以下 XPath 表达式.它搜索带有 u 子元素的 span,然后选择下面的第一个文本.

You can use the following XPath expression. It searches for a span with a u child, then it selects the first following text.

//span[u]/following-sibling::text()[1]