1

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

我可以这样做吗?

4

1 回答 1

1

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
于 2020-06-16T12:37:44.903 回答