Kadiem Alqazzaz
Kadiem Alqazzaz

Reputation: 659

Android Jsoup how to get this element

Here is html:

<span id="priceblock_ourprice" class="a-size-medium a-color-price"><span class="currencyINR">&nbsp;&nbsp;</span> 69,000.00</span>

I want to get that 69,000.00 at the end I tried

.replace("<span class=\"currencyINR\">&nbsp;&nbsp;</span>","")

But it didn't work

Upvotes: 0

Views: 47

Answers (1)

TDG
TDG

Reputation: 6151

For the above html you can use the text method:

String html = "<span id=\"priceblock_ourprice\" class=\"a-size-medium a-color-price\">"+
            "<span class=\"currencyINR\">&nbsp;&nbsp;</span> 69,000.00</span>";
Document doc = Jsoup.parse(html);
String output;
output = doc.text();
System.out.println(output);

And the result:

   69,000.00

Upvotes: 1

Related Questions