Java HTML Jsoup Element getTextFromNodeSelect(Element doc, String location, String locationValue)

Here you can find the source of getTextFromNodeSelect(Element doc, String location, String locationValue)

Description

get Text From Node Select

License

Open Source License

Declaration

public static String getTextFromNodeSelect(Element doc, String location, String locationValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.jsoup.nodes.Element;

public class Main {
    public static String getTextFromNodeSelect(Element doc, String location, String locationValue) {
        String[] locations = location.split(",");
        Element element = doc.select(locations[0] + "[" + locations[1] + "=" + locationValue + "]").first();
        String result = (element != null) ? element.text() : "none";
        return result.trim();
    }/* w  w w  .j  ava2 s .  com*/
}

Related

  1. getString(Elements td, int i)
  2. getTextContent(Element node)
  3. getTextFromAClass(Element doc, String location)
  4. getTextFromMultipleSelect(Element doc, String location, String locationValue)
  5. getTextFromNodeIfAvailable(Element doc)
  6. getTitle(Element el, String[] titles)
  7. getUserId(Element authorElement)
  8. isChildOf(Element child, Elements possibleParents)
  9. isEmptyElement(Node node)