The following Jsoup statement works:
Elements divs = document.select("div[class=mncls sbucls]");
But the equivalent statment:
Elements divs = document.select("div.mncls sbucls");
Doesn't work.
Why?
Does Jsoup have a problem with class names that have spaces?
A space is a descendent selector:
http://www.w3.org/TR/CSS2/selector.html#descendant-selectors
In your second example, when you put the space in there, you're denoting another element/class/selector, whereas in your first example you're explicitly grouping the selector into a single string (including the space).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With