zoukankan      html  css  js  c++  java
  • java实现复制网站内容

    复制网站内容
    复制代码
    本程序将网站“www.baidu.com”首页的内容复制保存在文件test.html中。写了如下代码,请完善之:

    import java.net.*;
    import java.io.*;
    class DaSai{
        public static void main(String[] args) throws Exception {
            URL url=__________________________________;
            BufferedReader in =_________________________________;
            String inString;     
            File outfile=new File("test.html");      
            PrintWriter out=new PrintWriter(new FileWriter(outfile));
            while ((inString=in.readLine())!=null){ 
                   out.println(inString);
            }
            in.close(); 
            out.close();
         }
     }
    
    
    new URL("http://www.baidu.com")
    
    new BufferedReader(new InputStreamReader(url.openStream()))
    
  • 相关阅读:
    移动布局---1. 移动端布局基础
    1. CSS新特性之选择器
    1. H5新增语义化标签
    POJ 3281
    poj 1986
    POJ 3728
    poj 2763
    poj 2749
    uva 11294
    LA 3713
  • 原文地址:https://www.cnblogs.com/a1439775520/p/13077016.html
Copyright © 2011-2022 走看看