Re: parser help

Ernest Cronin <[email protected]> Fri, 24 Aug 2012 15:14:06 -0400
Newsgroups gmane.comp.parsers.htmlparser.user
Message-ID <CAJyx_H017AToQ7YtRdgeAYnnrBf6-J6Jd6zijNhMkazCWbsF+A@mail.gmail.com>
Hi,

I use the parser a lot for work. one thing i've noticed is that in many
news articles there are comment sections, and in these sections, plain
text. but the parser doesn't pick them up. what is about the comment
sections that make it unreadable? is there a different class i should be
using?

Thank you,
ernest

On Wed, Aug 17, 2011 at 4:25 PM, ernest cronin <[email protected]>wrote:

> 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
>
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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