Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsoup - How do I filter all elements that are contained in a div of a specific class?

Tags:

jsoup

I have a div that contains lots of stuff I want to ignore.

<div class="product-list">
...tons of stuff many levels deep that I want to ignore
</div>

I tried tacking .product-list at the end of a list of "not" selectors, like this:

elements.not("sel1, sel2, sel3, .product-list");

Then I tried tacking .product-list * at the end of a list of "not" selectors thinking that meant all children of elements of the class ".product-list", like this:

elements.not("sel1, sel2, sel3, .product-list *");

None of this has worked. Any ideas?

like image 473
Doug Knesek Avatar asked Dec 19 '25 01:12

Doug Knesek


1 Answers

if you are trying to skip div class use pesudo selector like this

div:not(.product-list) 

it should work

like image 150
Elijah Avatar answered Dec 21 '25 03:12

Elijah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!