Java HTML Jsoup Element getTextFromAClass(Element doc, String location)

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

Description

get Text From A Class

License

Open Source License

Declaration

public static String getTextFromAClass(Element doc, String location) 

Method Source Code

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

import org.jsoup.nodes.Element;

public class Main {
    public static String getTextFromAClass(Element doc, String location) {
        Element elementByItemprop = doc.select("a[class=" + location + "]").first();
        String result = (elementByItemprop != null) ? elementByItemprop.text() : "none";
        return result;
    }//from w  w w  .j a v a2  s  .  c  om
}

Related

  1. getReviewAuthorIDFromMultipleSelect(Element doc, String location, String locationValue)
  2. getSingleElement(final Elements elements)
  3. getSrcOrRelFromImageElement(Element imgElm)
  4. getString(Elements td, int i)
  5. getTextContent(Element node)
  6. getTextFromMultipleSelect(Element doc, String location, String locationValue)
  7. getTextFromNodeIfAvailable(Element doc)
  8. getTextFromNodeSelect(Element doc, String location, String locationValue)
  9. getTitle(Element el, String[] titles)