• Post Reply Bookmark Topic Watch Topic
  • New Topic

about threads and URL  RSS feed

Michael Keisu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I'm using URL(and its openStream method) from Java API to retrieve data from a website, I use StringBuilder to append each HTML/source line into a String. Then use indexOf() and substring() methods to help with the actual (specific) data extraction. I wonder if there is some more efficient way to extract data from websites?

I suppose the most relevant piece of code would be:

If I have got the purpose of threads right, it is for the program to be able to execute multiple instructions at the same time rather than one at a time?
I have only just started learning threads, but I want to make use of it ASAP, to increase performance by extracting data from different places on a website at the same time. Is this a bad idea? I dont really want to put strain on servers. Is there a good way to do this?

My apologies if this belongs to beginner forum, I'm not quite sure what programming level "threads" are on.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!