Re: [Htmlparser-user] How to use it.
Brought to you by:
derrickoswald
From: Navid H.L. <na...@ya...> - 2002-11-25 19:28:52
|
Hi Somik, I am still getting this error. Here I send a sample code, which if you run, you will get the error. Please see the attachment. Thanks Navid --- 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 |