
我目前正在使用此:
String content = null;URLConnection connection = null;try { connection = new URL("http://www.google.com").openConnection(); Scanner scanner = new Scanner(connection.getInputStream()); scanner.useDelimiter("\Z"); content = scanner.next(); scanner.close();}catch ( Exception ex ) { ex.printStackTrace();}System.out.println(content);但不确定是否有更好的方法。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)