• Post Reply Bookmark Topic Watch Topic
  • New Topic

Speeding up the URL  RSS feed

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.
kit.read(rd, doc, 0);

// Iterate through the elements of the HTML document.
ElementIterator it = new ElementIterator(doc);
javax.swing.text.Element elem;
while ((elem = it.next()) != 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 ]
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!