如何组合这些 xpath 表达式? [英] How do I combine these xpath expressions?

查看:24
本文介绍了如何组合这些 xpath 表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 Xpath 表达式...

I have two Xpath expressions ...

//*[@id='gutter']/p[strong[text()='Date:']]/text()
//*[@id='gutter']/p[strong[text()='Time:']]/text()

如何编写一个单独的 xpath 表达式来组合上述两个表达式,并返回与单独运行上述每个表达式的结果相同的节点集?

How do I write a single xpath expression that combines the two above and would return the same node-set as combining the results of running each of the expressions above individually?

推荐答案

怎么样:

//*[@id='gutter']/p[strong[text()='Date:' or text()='Time:']]/text()

这或多或少是不言自明的.

which is more or less self-explanatory.

这篇关于如何组合这些 xpath 表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆