Re: Re: Re: Re: [Htmlparser-user] Bug found
Brought to you by:
derrickoswald
From: Cheng J. <c....@sm...> - 2002-07-03 03:20:17
|
Dear Somik Raha, Thank you. I set the int var 1. It works now. I am not sure I understand.. As I mentioned earlier, the linkTag.getLink() provides you the absolute link (check http://htmlparser.sourceforge.net/javadoc/com/kizna/html/tags/HTMLLinkTag.html) Sorry, the getLink() sometimes give the realtive link. Best wishes, Cheng Jun 2002-07-03 =============2002-07-03 You write========== Hi Cheng, Would you please explain the meaning of next variable??? THX. Sorry, I forgot about that.. The second variable is a string which denotes a default url. This is the url that will be used for resolving relative links. You can ignore the int param.. Regards, Somik ----- Original Message ----- From: Cheng Jun To: htm...@li... Sent: Wednesday, July 03, 2002 12:00 AM Subject: Re: Re: Re: [Htmlparser-user] Bug found Dear Somik Raha, THX for your reply. I tried your suggesting at once. But got a problem. You gave me the code below. StringReader sr = new StringReader(sb.toString()); HTMLReader reader = new HTMLReader(new BufferedReader(sr)); This should be HTMLReader(BufferedReader , int p1 / String p1) HTMLParser parser = new HTMLParser(reader); Would you please explain the meaning of next variable??? THX. Best wishes, Cheng Jun 2002-07-03 =============2002-07-03 You write========== Hi Cheng, This is just a little problem. In my project I need the absolute link. You may write another method to give the absolute link output. I am not sure I understand.. As I mentioned earlier, the linkTag.getLink() provides you the absolute link (check http://htmlparser.sourceforge.net/javadoc/com/kizna/html/tags/HTMLLinkTag.html) Another sugguestion. I write the my own page downloader. The problem is your parsing only paring the page avaiable in the HD. Could you give us another interface to parse the page content stored in a String or StringBuffer or something else. Oh, you can parse pages off a StringBuffer :). In fact, this is the basis of all testcases written for the parser. Check the source and see any of the scanner testcases. If you have a StringBuffer- this is what you could do - assuming you had a string buffer - sb. StringReader sr = new StringReader(sb.toString()); HTMLReader reader = new HTMLReader(new BufferedReader(sr)); HTMLParser parser = new HTMLParser(reader); Thats it! You can start parsing now. This is how we have over 100 tests, giving specific inputs to the parser. HTH. Cheers, Somik ======================================== ======================================== |