Java HTML Parse Jsoup htmlArray2textArray(List htmlArray)

Here you can find the source of htmlArray2textArray(List htmlArray)

Description

html Arraytext Array

License

Apache License

Return

A list of clean strings or an empty list.

Declaration

public static List<String> htmlArray2textArray(List<String> htmlArray) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

import org.jsoup.Jsoup;

public class Main {
    /**/*w w  w  .  java 2  s . co  m*/
     * @return A list of clean strings or an empty list.
     */
    public static List<String> htmlArray2textArray(List<String> htmlArray) {
        List<String> cleanTextArray = new ArrayList<>();
        if (htmlArray == null) {
            return cleanTextArray;
        }
        for (String html : htmlArray) {
            cleanTextArray.add(Jsoup.parse(html).text());
        }
        return cleanTextArray;
    }
}

Related

  1. getJSFileLinks(String html)
  2. getMetaValue(String html, String metaKey)
  3. getPlainText(String htmlText)
  4. getPlainTextFromHtml(String html)
  5. getTitle(String htmlContent)
  6. isHTMLEmpty(String textToCheck)
  7. parse(final String html)
  8. parse(InputStream input, String documentIRI, String encoding)
  9. parse(String html)