Ke10 Ke10 - 1 year ago 64
Java Question

Java jsoup how to see if a class is in the html

The class is

is it possible too see if this is in the html of the site? I've sifted through some of the documentation but couldn't find anything.

Answer Source

You can select elements by ID and check the length of the array you receive

if(doc.getElementsByClass("error_ctn").size() == 0){
    //element with that class is not in HTML
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download