1. 首页
  2. 数据库
  3. 其它
  4. 使用Java抓取网页数据

使用Java抓取网页数据

上传者: 2021-01-01 01:40:01上传 PDF文件 27.57KB 热度 22次
一、使用 HttpClient 抓取网页数据 public String getHtml(String htmlurl) throws IOException { StringBuffer sb = new StringBuffer(); String acceptEncoding = ""; /* 1.生成 HttpClinet 对象并设置参数 */ HttpClient httpClient = new HttpClient(); GetMethod method = new GetMethod(htmlurl); int statusCode; try { status
下载地址
用户评论