List of usage examples for org.jsoup.nodes Document getElementsByAttributeValueEnding
public Elements getElementsByAttributeValueEnding(String key, String valueSuffix)
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; }