Nokogiri xpath() '或'操作员?
有没有办法使用 Nokogiri 的 xpath()
完成以下任务?
doc.xpath("//pod[@id=or('anid','anotherid')]")
Is there a way I can accomplish the following using Nokogiri's xpath()
?
doc.xpath("//pod[@id=or('anid','anotherid')]")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试 doc.xpath("//pod[@id='anid' 或 @id='anotherid']")
Try
doc.xpath("//pod[@id='anid' or @id='anotherid']")
试试这个 XPath:
Try this XPath:
这也对我有用:
它返回
NodeSet
我得到这样的代码:
它返回
true
insted NodeSetThis also worked for me:
It returns
NodeSet
I got code like this:
And it return
true
insted NodeSet