Comment extraire du texte de paragraphe html à l'aide de Jsoup?

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class JavaApplication14 {


public static void main(String[] args)  {
    try {
        Document doc = Jsoup.connect("tanmoy_mahathir.makes.org/thimble/146").get();  
         String html= "<html><head></head>" + "<body><p>Parsed HTML into a doc."
                 + "</p></body></html>"; 
  Elements paragraphs = doc.select("p");
  for(Element p : paragraphs)
    System.out.println(p.text());
    } catch (IOException ex) {
        Logger.getLogger(JavaApplication14.class.getName()).log(Level.SEVERE, null, ex);
    }
}

}

quelqu'un peut m'aider avec jsoup code comment puis-je analyser seulement une partie, y compris paragraphe, de sorte qu'il suffit d'imprimer

Hello ,World!
Nothing is impossible
j'ai juste essayé ce imporjava.io.IOException; import org.jsoup.*; import org.jsoup.les nœuds.Document; public class JavaApplication10 { /** * @param args les arguments de ligne de commande */ public static void main(String[] args) throws IOException { Document document = Jsoup.connect("tanmoy_mahathir.makes.org/thimble/146").get(); String html; html = "<html><head></head>" + "<body><p>HTML Analysée dans un doc.</p></body></html>"; Document doc = Jsoup.parse(html); // ... } }
Je note que vous ne l'utilisez pas document... et tu ne fais rien avec doc après l'avoir créé.

OriginalL'auteur Tanmoy Mahathir | 2013-06-18