Example usage for org.jsoup.select Selector select

List of usage examples for org.jsoup.select Selector select

Introduction

In this page you can find the example usage for org.jsoup.select Selector select.

Prototype

public static Elements select(String query, Iterable<Element> roots) 

Source Link

Document

Find elements matching selector.

Usage

From source file:com.jimplush.goose.ContentExtractor.java

private Set<String> extractTags(Element node) {
    if (node.children().size() == 0)
        return NO_STRINGS;

    Elements elements = Selector.select(A_REL_TAG_SELECTOR, node);
    if (elements.size() == 0)
        return NO_STRINGS;

    Set<String> tags = new HashSet<String>(elements.size());
    for (Element el : elements) {
        String tag = el.text();/*  w  ww . j  a v a 2  s  .c  om*/
        if (!string.isNullOrEmpty(tag))
            tags.add(tag);
    }

    return tags;
}