parser help

ernest cronin <[email protected]> Wed, 17 Aug 2011 16:25:33 -0400
Newsgroups gmane.comp.parsers.htmlparser.user
Message-ID <CAJyx_H0hWmcc6ok7OyHbRzh6qwfg101Dm6CeaAxS+8iFEwawfA@mail.gmail.com>
Hi,

I have been trying to use the parser for some time and I have been unable to
get it to do exactly what I want, which is to gather only the plaintext
without javascript or style stuff. Here is the code I've been running:

  public class Test
   {
      public static void main (String[] args)
      {
         try
         {
            Parser parser = new Parser (args[0]);
    TextExtractingVisitor visitor = new TextExtractingVisitor();
    parser.visitAllNodesWith(visitor);
      String textInPage = visitor.getExtractedText();
   System.out.println(textInPage);
         }
            catch (ParserException pe)
            {
               pe.printStackTrace ();
            }
      }
   }

I could really use some help with this!

Thanks,
Ernest

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2

_______________________________________________
Htmlparser-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlparser-user