How to extract a text within a <dd> using Jsoup?

Asked

Viewed 10 times

0

Talk, you guys, baby?

I’ve been trying for a couple of hours, and I’ve already researched everything that is a place to fix it, question is as follows:

I need to know if an X text is like "OK" or "Error" whenever I access the printer’s website. If I run the executable and the text is different from "OK status" in the URL I need, it will alert me in the log.

The code is like this:

        doc = Jsoup.connect("URL que preciso").get();
                    
        Elements status_tonner_exp = doc.getElementsByClass("listboxddm");      
        System.out.println("Status Tonner Expedicao :" + status_tonner_exp);

Problem is that the class of is this listboxddm within the URL, only that there are 21939129329131 classes with other information, I needed to know of only one specifically (the tonner). that in the case is like this:

 <div class="float-l" style="width:26px;">
  <img src="/images/deviceStToner_16.gif" alt="" width="16" height="16" class="ver-algn-m">
 </div>
Status OK
</dd>

How could I do that?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.