xpath - Xidel:如何打印出节点而不是值?
问题描述
html示例:
<p class="si-price" data-price="910000.00">Rp 910.000</p>
所以在xidel,我这样做:
xidel -se '(//p[@class="si-price"])[1]' 'https://www.anekalogam.co.id/id'
我想要的910000
是在data-price
而不是Rp 910.000
我可以这样做吗?
解决方案
Try changing it to:
xidel -se '(//p[@class="si-price"])/@data-price' 'https://www.anekalogam.co.id/id'
Output:
905000.00
1750000.00
2595000.00
4300000.00
8550000.00
21250000.00
42400000.00
84000000.00
推荐阅读
- for-loop - 使用 for 循环删除最后一个字符
- swiftui - 如何在swiftUI中去另一个视图onclick LazyVGrid GridItem?
- python - 做简单的python递归时出现问题
- mqtt - 当我在 verneMQ 集群中重新启动代理时,排队的消息会丢失
- javascript - 我想点击一个单选按钮
- python - tkinter 函数如何处理它作为参数的列表,一个接一个,一个接一个?
- python - 我如何让机器人不仅考虑自己
- python - 为什么 selenium 只迭代 5 次而不是完成数据集
- python - 如何在 Python 中使用 urlparse 优雅而安全地从部件创建 URL
- powershell - 在 Powershell 中获取具有其他属性的文件哈希