Re: [Htmlparser-developer] parsing error of a html page
Brought to you by:
derrickoswald
|
From: Derrick O. <Der...@ro...> - 2003-04-09 21:58:49
|
Ling,
The StringExtractor gets every StringNode.
If you don't want the comments (script) try this:
#import org.htmlparser.beans.StringBean;
public class TryBeans
{
public static void main (String[] args)
{
StringBean sb = new StringBean ();
sb.setURL ("http://www.cnnfn.com/2001/11/29/companies/enron/");
System.out.println (sb.getStrings ());
}
}
See http://htmlparser.sourceforge.net/docs/index.php/JavaBeans for more
details.
Derrick
Mr LING MA wrote:
>When I try to use htmlparser stringextractor on page:
>
>http://www.cnnfn.com/2001/11/29/companies/enron/
>
>the comment tags below is also outputted. Can this
>be an error of style tag or comment tag?
>
>Thanks
>
>Ling Ma
>
>OUTPUT after extracted tag:
><!--
>adSetTarget('_top');
>htmlAdWH( (new
>Array(93106768,93108498,93108099,93108099))[document.adoffset||0]
>, 160, 600);
>//-->
>160AD end right column top popunder ad
>generic/popunder_launch.720x300
><!--
>if (document.adPopupFile) {
> if (document.adPopupInterval == null) {
> document.adPopupInterval = 0;
> }
> if (document.adPopunderInterval == null) {
> document.adPopunderInterval =
>document.adPopupInterval;
> }
> if (document.adPopupDomain != null) {
> adSetPopDm(document.adPopupDomain);
> }
> adSetPopupWH(93165927, 720, 300,
>document.adPopupFile, document.adPopunderInterval, 20,
>50, -1);
>}
>// -->
> CNNmoney contact us | magazine customer service
>| <a href="/" class="footerlink">advertising</a> |
>site map | CNN/Money glossary | press room OTHER
>NEWS: CNN | SI | Fortune | Business 2.0 | Time ©
>2003 Cable News Network LP, LLLP. An AOL Time Warner
>Company ALL RIGHTS RESERVED.Terms under which this
>service is provided to you. privacy
>policy Reprints of site stories are
>available.endclickprintexclude
><!--
>var clickExpire = "-1";
>if(window.btnDone) btnDone();
>//-->
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Tax Center - File online, calculators, forms, and more
>http://tax.yahoo.com
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
>for complex code. Debugging C/C++ programs can leave you feeling lost and
>disoriented. TotalView can help you find your way. Available on major UNIX
>and Linux platforms. Try it free. www.etnus.com
>_______________________________________________
>Htmlparser-developer mailing list
>Htm...@li...
>https://lists.sourceforge.net/lists/listinfo/htmlparser-developer
>
>
>
|