Re: Help

Asutosh Parida <[email protected]> Tue, 4 Oct 2011 11:02:29 +0530
Newsgroups gmane.comp.parsers.htmlparser.user
Message-ID <CALhbpYttnGN4QBQbHNdZ8Z=Op_dzWfVCOr9h+2qcdctrgYYn+g@mail.gmail.com>
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 <[email protected]>

> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/htmlparser-user
>
>
Thanks & Regards

Asutosh .

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlparser-user