try { URL url = new URL("https://www.baidu.com/"); URLConnection urlc =url.openConnection(); BufferedReader bf=new BufferedReader(new InputStreamReader(urlc.getInputStream(),"UTF-8")); String len=null; while ((len=bf.readLine())!=null){ System.out.println(len); } } catch (Exception e) { e.printStackTrace(); }
java利用url写个抓取服务器文件
最新推荐文章于 2021-08-03 15:15:41 发布