famemaker famemaker - 2 years ago 104
Java Question

Jsoup - how to check if Element is of specific class?

This is my Element code:

<tr class="footer">...</tr>

In the table there are also other rows with other classes and I process each of them. How can I know if this processed
element has "footer" class?

Answer Source

You're looking for the Element#hasClass method.

if (element.hasClass("footer")) {
    // do something
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download