Re: [Htmlparser-user] How to use it.
Brought to you by:
derrickoswald
From: Somik R. <so...@ya...> - 2002-11-25 19:50:29
|
Hi Navid, I ran the program, and it does exactly what I expected. But I see your doubt now. You want to suppress the exception messages. These are happening because of DefaultHMLParserFeedback(). Pls write your own NullHTMLParserFeedback(), that does not print anything when it encounters an error, and use that to initialize the parser. Read the javadoc of HTMLParser.java carefully. > --- Somik Raha <so...@ya...> wrote: > > Hi Navid, > > > > > > > I still need your help. > > > I am getting some exception errors in my > program, > > it > > > happens when it tried to open a url to a non > > existing > > > page. > > > I tried some try/catch, but still can't catch > this > > > one. > > > It says > > > Error: HTMLParser.oprnURLConnection(): Error in > > > opening a URL connection to > > > http://www.somenoneexistingurl.com ....... > > > > > > How can I skip this, my program reads all urls > of > > a > > > site and tries to go to next page, and if the > url > > does > > > not exist or is wrong, it terminats, I think I > > should > > > control this in order to let the program carry > on > > on > > > correct links. > > > > I wrote a testcase for this - in > > HTMLParserTest.java. This test proves that > > there is no bug in the parser. You can add this > > snippet and verify for > > yourself. > > > > public void testNullUrl() { > > HTMLParser parser; > > try { > > parser = new > > HTMLParser("http://someoneexisting.com"); > > assertTrue("Should have thrown an > > exception!",false); > > } > > catch (HTMLParserException e) { > > } > > } > > > > I can guess what you might be doing wrong though > .. > > are you sure you are > > trying to trap HTMLParserException ? > > > > Regards, > > Somik > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus Powerful. Affordable. Sign up > now. > http://mailplus.yahoo.com __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |