I am learning Java and I have come upon a challenge to make a web address extractor. The program does nothing but sweeps through the page given to it to find external links in it. I have an idea on how to do that but I am having some trouble implementing the sockets class. What I need help with is I need to make a socket which will connect to the html page using port 80. Next, i need the complete html of that page into an input stream of the socket so that I can manipulate with it to extract the links.
To sum up, clarification on the following things is what I need:
- get html of the page into the input stream of the socket.
- print input stream onto the console.
EDIT: Sorry my bad. Confused output stream with input stream.