I'm making a program that reads html from a website and pulls some things from the html. When I try to start my socket I get the UnknownHostException error. It happens when I call the InetAdress method as well. I've tried multiple ways of doing this including not using the inetaddress method and it doesn't help anything. Here's what the code looks like
try {
InetAddress add = InetAddress.getByName(text);
} catch (UnknownHostException e1) {
}
try {
Socket socket = new Socket(text,80);
PrintWriter out = new PrintWriter(socket.getOutputStream());
}
text... Also, why do you need the InetAddress.getByName() call?