黑马程序员技术交流社区

标题: 网页复制 [打印本页]

作者: 非5莫属    时间: 2014-7-11 21:59
标题: 网页复制
import java.io.*;
import java.net.*;
public class GetURLContent {
        public static void main(String[] args)throws MalformedURLException,IOException{
                URL url=new URL("http://bbs.itheima.com/forum-206-1.html");
                BufferReader reader=new BufferReader(new InputStreamReader(url.openStream()));
                while(reader.ready()){
                        System.out.println(reader.readLine());
                }
        }
}







欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2