package bebo.app.core;
import java.io.*;
import java.net.*;
public class test {
public static void main(String args[]){
try{
URL u=new URL("http://www.bebo.com/c/apps/browse_apps?sort=AZ");
URLConnection uc=u.openConnection();
InputStream raw=uc.getInputStream();
InputStream buffer=new BufferedInputStream(raw);
//
Reader r=new InputStreamReader(buffer);
int c;
while((c=r.read())!=-1){
System.out.print((char) c);
} //end while
}//end try
//catch (MalformedURLConnection e){
// System.err.println("cannot connect");
// }
catch (IOException e){
System.err.println(e);
}// end catch
}// end main
}//end test
Java 得到HTML源码
最新推荐文章于 2024-07-10 03:36:36 发布