Re: Re: [Htmlparser-user] Bug found
Brought to you by:
derrickoswald
From: Somik R. <so...@ya...> - 2002-07-03 02:33:05
|
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.=20 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)=20 Another sugguestion. I write the my own page downloader. The problem is = your parsing only paring the page avaiable in the HD.=20 Could you give us another interface to parse the page content stored in = a String or StringBuffer or something else.=20 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 =3D new StringReader(sb.toString()); HTMLReader reader =3D new HTMLReader(new BufferedReader(sr)); HTMLParser parser =3D new HTMLParser(reader); Thats it! You can start parsing now. This is how we have over 100 tests, = giving specific inputs to the parser.=20 HTH. Cheers, Somik |