El código que uso para leer la url es este:
Código:
public class leerURL { private String codigo; public leerURL(String sitioweb) throws IOException{ try { java.net.URL url = new java.net.URL(sitioweb); java.net.URLConnection con = url.openConnection(); InputStream s = con.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(s)); codigo = ""; String line = ""; while((line = bufferedReader.readLine())!=null){ codigo+=line+"\n"; //System.out.println(line); } } catch (java.net.MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public String getCodigo(){ return codigo; } }