Here you can find the source of getReviewAuthorIDFromMultipleSelect(Element doc, String location, String locationValue)
public static String getReviewAuthorIDFromMultipleSelect(Element doc, String location, String locationValue)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Element; public class Main { public static String getReviewAuthorIDFromMultipleSelect(Element doc, String location, String locationValue) { String author_id = getAttributeFromMultipleSelect(doc, location, locationValue); if (!author_id.equals("none")) { author_id = (author_id != null) ? (author_id.split("=")[1]) : "none"; }/*from w w w .j av a2 s .c om*/ return author_id.trim(); } public static String getAttributeFromMultipleSelect(Element doc, String location, String locationValue) { String[] locations = location.split(","); String[] locationValues = locationValue.split(","); Element element = doc.select(locations[0] + "[" + locations[1] + "=" + locationValues[0] + "]").first(); element = element.select(locations[2] + "[" + locations[3] + "]").first(); String result = (element != null) ? element.attr(locations[3]) : "none"; return result.trim(); } }