Package wordcram.text

Source Code of wordcram.text.Html2Text

package wordcram.text;

import org.jsoup.Jsoup;
import org.jsoup.select.Elements;
import org.jsoup.nodes.Document;

class Html2Text {
  public String text(String html, String cssSelector) {
    Document doc = Jsoup.parse(html);

    if (cssSelector == null) {
      return doc.text();
    }
    else {
      return doc.select(cssSelector).text();
    }
  }
}
TOP

Related Classes of wordcram.text.Html2Text

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.