Q:

Selector syntax in jsoup

I want to get the text of any tag which contains an attribute with a value lik description in it. 
for eg:-
<div id="id_description"> value to be fetched </div>
<span class="a-list-description-value">value to be fetched </span>

how can i achieve this? 

A:

This method will get the text from any Element that has an attribute containing the term "description", and store it to an ArrayList:
ArrayList<String> results = new ArrayList<String>();

for(Element e : doc.getAllElements()) {
    for(Attribute attribute : e.attributes()) {
        if(attribute.getValue().contains("description")) {
            results.add(e.text());
        }
    }
}

Using your sample HTML, results will contain:
[value to be fetched, value to be fetched]

