0
I’m taking content from an HTML page, I’m selecting content for a specific class, but in this case this class has content with a href and span, I can only take one.
Document doc = Jsoup.connect("https://www.sinonimos.com.br/"+texto+"/" ).get();
Elements classHTML = doc.getElementsByClass("sinonimos").select("a[href]");
How I would filter to get the span also?
It is not clear what information you want to take. Give an example of the element and what you want to isolate from it (in both cases)
– Sorack
I was able to solve it. Elements classHTML = doc.getElementsByClass("synonyms"). select("a[href],span"); I only used "," to use more than one attribute.
– Falcao Negro
It would be interesting to put an answer explaining what you did.
– Sam