Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Speeding up the URL

Kumar Manthri
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 200 links stored in my database, I use JDBC ODBC, to take the links, I pass it to a
URL u = new URL(link);
N:B link -is the link I recieve form the database
then I use
Reader rd = new InputStreamReader(u.openStream());
EditorKit kit = new HTMLEditorKit();
Document doc = kit.createDefaultDocument();
doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
// Parse the HTML., doc, 0);

// Iterate through the elements of the HTML document.
ElementIterator it = new ElementIterator(doc);
javax.swing.text.Element elem;
while ((elem = != null)
st1 = new String();

SimpleAttributeSet s = (SimpleAttributeSet)elem.getAttributes().getAttribute(HTML.Tag.A);
if (s != null)

st1 = s.getAttribute(HTML.Attribute.HREF).toString();
this takes a long time, if the links are broken it take 10 minutes to go to the next page, I need this done fast. please help
P.S :- If any body has a Kleinberg API I can use, it will be great help
[ July 17, 2003: Message edited by: Kumar Manthri ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic