50,523
社区成员
发帖
与我相关
我的任务
分享
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package test;
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;
/**
*
* @author Administrator
*/
public class DecodeHtml {
public static void main(String[] args) {
try {
Document doc = Jsoup.connect("http://www.jtxx0551.com/hfwsslkiframe.action").get();
//Element content = doc.getElementsByClass("gs_bluezi");
try {
Elements links = doc.getElementsByTag("p");
for (Element link : links) {
String linkText = link.text();
System.out.println(linkText + "");
}
} catch (Exception e) {
// TODO: handle exception
}
} catch (IOException ex) {
Logger.getLogger(DecodeHtml.class.getName()).log(Level.SEVERE, null, ex);
// TODO: handle exception
}
}
}
Document doc = Jsoup.connect("http://www.jtxx0551.com/hfwsslkiframe.action").get();
Elements links = doc.select("p");
for (Element link : links) {
String linkText = link.text();
System.out.println(linkText+"");
}