xpathxidel

Xidel: How to printout the node instead of the value?


html example:

<p class="si-price" data-price="910000.00">Rp 910.000</p>

so in xidel, i do this:

xidel -se '(//p[@class="si-price"])[1]' 'https://www.anekalogam.co.id/id'

what I want is 910000 which is in the data-price instead of Rp 910.000

can I do that?


Solution

  • 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