html htmlparser extract the text content of the specified label

Category: Java Related
2010-02-17 09:19:22

Sponsored Links
<title> China Tibet Network </title>

China Tibet Information Center Web site (hereinafter referred to as Ben) on the information released the following statement: a All information published on this site, designed to objectively introduce China's Tibet, Tibet's progress through the presentation and development, promotion Xinrenxinshi, for the audience to recognize Tibet to provide information services, not for profit purposes. Ben has always guard against any damage to the national and individual interests behavior. The contents of this site are reproduced two reliable sources, the Department has a clear provenance, the copyright belongs to the original author. Due to the conditions, if any, can not I get in touch with the author or authors do not agree with the content published on this site, or if you notice any mistakes, please contact the webmaster, we will respect the author's willingness to be corrected promptly. Three of any organization or individual will be allowed to make use of this site without permission of the content surplus


< ;/ source>


<content> I want to extract the contents of the label should be how to do ? Specific point. . New to htmlparser, less clear filter. . .

Sponsored Links

2010-02-17 09:24:07
String html = Above;
Parser parse = new Parser (html);
NodeFilter filter ; = new TagNameFilter ("content");
NodeList nodeList = parse.parse (filter);
String res = nodeList.elementAt (0). toPlainTextString ();

Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.