I am writing a java program that connects to a website and it returns the HTML, for some reason I am having problems with it. Right now I am only able to access the website if I do
//example String host = "www.google.com"
but If I want to access a URL that is any more complicated then I get an UnknownHostException. At first I thought it might have something to do with it not recognizing certain characters in the URL but im not sure. For example, here is one of the URL's Im trying to access.
host ="http://www.cyberspacei.com/englishwiz/library/name/etymology_of_first_names.htm";
int port = 80;
Socket s = new Socket(host,port)
....etc
and It wont return anything but an UnknownHostException.
Somebody please help me!!!