I am analyzing some tables from a website, and in particular, I am trying to extract the following cells by class name:
Elements e=d.select("span[class=bld lrg red]");
for (Element element : e) {
System.out.println(element.text());}
this code gives me some values that are given as Price on the website. but in some cases I want to take the price from another class, not "span[class=bld lrg red]".
I mean, the class "bld lrg red" is empty, then I want to take the value from "span [class = price]"
How can I use "or" in this case. I mean, if the class "bld lrg red" has a value, then take this price or take the value of the class "price".
source
share