How to concat two values in one column using import.io

166 views Asked by At

I am writing extractor for newegg.com using import.io. I am facing one difficulty while grabbing price values from listing page.

  <div class="item-price-now">
    <span>from</span>
     $
    <strong>108</strong>
    <sup>.00</sup>
    </div>

Price enclosed in two nodes, strong and sup. I want to get 108.00 as one node. When i tried following Xpath, i get values in two nodes.

//div[@class="item-price-now"]//strong/text() | //div[@class="item-price-now"]//sup/text()

Thanks in advance.

1

There are 1 answers

0
Bam4d On BEST ANSWER

You could use an xpath to just grab all the text within the div, then use a regular expression to filter it just to the text after the dollar.

xpath: //div[@class='item-price-now'] -> from $108.00

regex: \$d+\.\d+ -> $108.00