Example usage for org.jsoup.nodes Element getElementsByAttributeValueMatching

List of usage examples for org.jsoup.nodes Element getElementsByAttributeValueMatching

Introduction

In this page you can find the example usage for org.jsoup.nodes Element getElementsByAttributeValueMatching.

Prototype

public Elements getElementsByAttributeValueMatching(String key, String regex) 

Source Link

Document

Find elements that have attributes whose values match the supplied regular expression.

Usage

From source file:org.asqatasun.rules.accessiweb22.Aw22Rule06061.java

@Override
protected void select(SSPHandler sspHandler) {
    new SimpleElementSelector(NOT_ANCHOR_LINK_CSS_LIKE_QUERY).selectElements(sspHandler, linksHandler);

    if (linksHandler.isEmpty()) {
        return;/*w ww.j av a 2 s.c o  m*/
    }

    for (Element el : linksHandler.get()) {
        if (StringUtils.isBlank(el.text())
                && el.getElementsByAttributeValueMatching(ALT_ATTR, "^(?=\\s*\\S).*$").isEmpty()) {
            emptyLinksHandler.add(el);
        }
    }
}

From source file:org.asqatasun.rules.rgaa22.Rgaa22Rule06161.java

@Override
protected void select(SSPHandler sspHandler) {
    super.select(sspHandler);

    for (Element el : getElements().get()) {
        if (StringUtils.isBlank(el.text())
                && el.getElementsByAttributeValueMatching(ALT_ATTR, "^(?=\\s*\\S).*$").isEmpty()) {
            emptyLinksHandler.add(el);/* www  . jav a  2 s.c  om*/
        }
    }
}

From source file:org.asqatasun.rules.rgaa30.Rgaa30Rule060501.java

@Override
protected void select(SSPHandler sspHandler) {
    ElementSelector elementsSelector = new SimpleElementSelector(NOT_ANCHOR_LINK_CSS_LIKE_QUERY);
    elementsSelector.selectElements(sspHandler, linksHandler);
    for (Element el : linksHandler.get()) {
        if (StringUtils.isBlank(el.text())
                && el.getElementsByAttributeValueMatching(ALT_ATTR, "^(?=\\s*\\S).*$").isEmpty()) {
            emptyLinksHandler.add(el);/*from ww w.j a  v a2 s . c  o m*/
        }
    }
}

From source file:org.opens.tanaguru.rules.accessiweb22.Aw22Rule06061.java

@Override
protected void select(SSPHandler sspHandler, ElementHandler<Element> elementHandler) {
    ElementSelector elementsSelector = new SimpleElementSelector(NOT_ANCHOR_LINK_CSS_LIKE_QUERY);
    elementsSelector.selectElements(sspHandler, elementHandler);
    for (Element el : elementHandler.get()) {
        if (StringUtils.isBlank(el.text())
                && el.getElementsByAttributeValueMatching(ALT_ATTR, "^(?=\\s*\\S).*$").isEmpty()) {
            emptyLinksHandler.add(el);/*from  www. ja va  2s  . c o m*/
        }
    }
}