新闻正文提取之joyhtml
public static void main(String[] args) throws Exception {DOMParser parser = new DOMParser();String url = "http://finance.people.com.cn/n/2013/1011/c66323-23157265.html";parser.parse(new InputSource(new URL(url).openStream()));Document doc = parser.getDocument();TextExtractor extractor = new TextExtractor(doc);String str = extractor.extract();System.out.println(str);}
?
依赖的lib参见附件