I am trying to find all <div class="name1">
or <div class="name2">
tags in one page/document.
How can I use OR
operator in doc.select("div.name1 OR div.name2")
?
The select method of JSoup implements more or less the CSS selector syntax. So you can very simply use the CSS way of specifying alternatives, i.e. using ,
. This should work:
doc.select("div.name1,div.name2");
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