jaxrpc
asked on
getting URL content from https sites
hi
i have the follow code that works well when i try to get the content off non https sites like www.yahoo.com or www.google.com but when i try to get the content from https sites it gives me an hostexception error. It seems that it is not able to get content from https sites. Any way to do this?
i have the follow code that works well when i try to get the content off non https sites like www.yahoo.com or www.google.com but when i try to get the content from https sites it gives me an hostexception error. It seems that it is not able to get content from https sites. Any way to do this?
import java.net.*;
import java.io.*;
public class jget
{
public static void main ( String[] args ) throws IOException
{
try
{
URL url = new URL("http://www.yahoo.com");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while ((str = in.readLine()) != null)
{
System.out.println(str);
}
in.close();
}
catch (MalformedURLException e) {}
catch (IOException e) {}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.