How do I make it spend only part of the 1.25 € for String? link
How do I make it spend only part of the 1.25 € for String? link
By analyzing html, there is only one element with class realprice
on the page, so you can make a selector for that class. I'm only considering the page that you provided in the question, as details are missing, it's what you can answer.
Document document = Jsoup.connect("https://www.pingodoce.pt/produtos/tab-choc-negro-nestle-100g/")
.get();
// Pegando o índice "0" porque só há um elemento.
final String price = document.select(".realprice").get(0).text();
System.out.println("preço: " + price); // preço: 1.25€