Re: [Htmlparser-user] Help
                
                Brought to you by:
                
                    derrickoswald
                    
                
            
            
        
        
        
    | 
      
      
      From: Asutosh P. <as...@gm...> - 2011-10-04 05:32:37
      
     | 
| Hi,
zhouyang I don't know what is your requirement,but i used HTML parser to get
the body content of a html file
the code sample is down there ...Hope it will help you....
******************************************************************
 public static String getBodyOfResumeAsText(String path) {
        final String METHOD_NAME = "getBodyOfResumeAsText :";
        String plainText = "";
        NodeFilter filter = null;
        Parser parser = null;
        try {
                   parser = new Parser(path);
                   filter = new TagNameFilter ("body");
                   plainText = parser.parse(filter).asString();
                   plainText =
plainText.replaceAll("\\r\\n|\\r|\\n|\\s|\\s+", " ");
                   plainText = plainText.replaceAll(" {2,}", " ");
                   logger.debug(CLASS_NAME + METHOD_NAME + ":generating
plainText for :" + path);
                   logger.debug(CLASS_NAME + METHOD_NAME + ":plainText :" +
plainText);
        } catch (Exception e) {
                   e.printStackTrace();
        }
        return plainText;
    }
******************************************************************
2011/10/3 <zho...@si...>
> Hello,
>
>      There is a scentence "Although some example programs are provided that
> may be useful as they stand..." on HTML Parser home page.But I can't
> find the example programs in the Web site HTML Parser.Could you send a link
> or the examples' src to me? Thank you very much.
>
>     I'm a Chinese student and my English is poor, if there is something
> wrong in my email, please forgive me.I will try my best to improve my
> English.
>
>     I think HTML Parser is greate, she gives me so much help.Thank you very
> much again.
>
>                      Zhou Yang
>
>                   Oct 3 2011
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Htmlparser-user mailing list
> Htm...@li...
> https://lists.sourceforge.net/lists/listinfo/htmlparser-user
>
>
Thanks & Regards
Asutosh .
 |