Example usage for org.jsoup.nodes Document getElementsByAttributeValueEnding

List of usage examples for org.jsoup.nodes Document getElementsByAttributeValueEnding

Introduction

In this page you can find the example usage for org.jsoup.nodes Document getElementsByAttributeValueEnding.

Prototype

public Elements getElementsByAttributeValueEnding(String key, String valueSuffix) 

Source Link

Document

Find elements that have attributes that end with the value suffix.

Usage

From source file:org.cellcore.code.engine.page.GathererDataExtractor.java

private String getGathererId(Document document) throws Exception {
    Elements ids = document.getElementsByAttributeValueEnding("id", "otherSetsValue").select("a");
    long lastID = 0;
    String mRet = "";
    for (Element element : ids) {
        String multiverseId = element.attr("href");
        multiverseId = multiverseId.substring(multiverseId.indexOf("=") + 1, multiverseId.length());
        long cID = Long.parseLong(multiverseId);
        if (cID > lastID) {
            lastID = cID;/*ww  w .  j  a v a 2  s . c o  m*/
            mRet = multiverseId;
        }
    }
    if (lastID == 0) {
        throw new Exception("No other sets found");
    }
    return mRet;
}