1. 根据连接地址获取网页内容,解决中文乱码页面内容,请求失败后尝试3次 private static Document getPageContent(String urlStr) { for (int i = 1; i <= 3; i++) { try { URL url = new URL(urlStr); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // 默认就是Get,可以采用post,…